SpecFlow.VisualStudio icon indicating copy to clipboard operation
SpecFlow.VisualStudio copied to clipboard

Can I Limit the projects which specflow searches for tests when generating Step bindings?

Open wooger opened this issue 6 years ago • 3 comments

SpecFlow Version:

  • [ ] 2.4
  • [x] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

  • [ ] SpecFlow+Runner
  • [ ] MSTest
  • [x] NUnit
  • [ ] Xunit

Version number: 3.9

Visual Studio Version

  • [x] VS 2017
  • [ ] VS 2015
  • [ ] VS 2013

Are the latest Visual Studio updates installed?

  • [x] Yes
  • [ ] No

.NET Framework:

  • [x] >= .NET 4
  • [ ] before .NET 4

Test Execution Method:

  • [x] Visual Studio Test Explorer
  • [ ] TFS/VSTS – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [ ] Command line – PLEASE SPECIFY THE FULL COMMAND LINE

<SpecFlow> Section in app.config

  <specFlow>
    <language feature="en-GB" />
    <runtime missingOrPendingStepsOutcome="Error" />
    <stepAssemblies>
      <stepAssembly assembly="Deltafs.Platinum.SystemTests" />
    </stepAssemblies>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
    
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
  </specFlow>

Repro Project

None at present.

Issue Description

My new workplace has a very large C# solution in Visual Studio 2017 with over 100 projects, 70K files, 3000 feature files, of which only one project is directly relevant to my job (web acceptance tests via specflow & selenium). That project contains ~1000 feature files.

We have intermittent problems with CPU usage & tests not being found in the test explorer, occurring whenever Specflow decides it needs to search for and regenerate test bindings - as it takes some hours to complete, during which Visual Studio is not useful.

From experimentation, I know that if I open only the one project relevant to my work, then specflow finds all the tests in seconds and is immediately useable.

But sadly we need the whole solution to be loaded at least when building new code to be tested.

Is there a way to limit which projects (or paths) Specflow and/or test explorer is searching in for tests, & subsequently generating step bindings from?

I’m hoping for a local settings file (references to .runsettings), but haven’t been able to find any instructions for how to configure this.

Steps to Reproduce

Have a very large solution with 100+ projects, 70K+ files - including several projectsl with feature files - but only one project with .feature files you wish to test.

wooger avatar Sep 07 '18 10:09 wooger

@wooger Could you create such a big project for us to save us time?

SabotageAndi avatar Sep 19 '18 09:09 SabotageAndi

I'm not able to share any of our code I'm afraid. That said, the issue is not really one specific to our project, but one of being able to limit the scope of specflow step binding generation to specific project(s) within a solution.

I can try creating a simple solution with specflow tests spread out over say 3 projects - but I suspect you may have something suitable already.

wooger avatar Sep 19 '18 17:09 wooger

@wooger I didn't expect that you can share your code. What I meant is, that perhaps you create a new solution with that a lot of projects. With this, I can debug and profile the VS Extension to see where we have the performance problems.

My current assumption is, that we look into all projects for bindings and not only in the project which has a reference to TechTalk.SpecFlow.dll.

SabotageAndi avatar Sep 20 '18 06:09 SabotageAndi