Optimization for NUnit3
See original GitHub issueThe pull request providing the ability to generate fixed name for NUnit3 has just been merged (thanks again @zvirja).
I’m working on a project containing 8,000+ tests. The discovery phase is longer than a minute. In Visual Studio there is a separate process for discovering the tests: during this phase there is no point to create the fixture nor generate the parameter values since they won’t be used (we just generate a test name TestName(auto<string>)
.
I successfully tested the following:
- Have the ability to use a constructor for AutoData that takes a
Func<IFixture>
parameter instead ofIFixture
. See this line. For backward compatibility the existing constructor does still exist. - The IFixture factory is only invoked when argument values are required, and argument values are generated only if we are not in a discovery process. See this util type.
Please let me know if this is something that could be merged in this project, in which case I can submit a pull request. Wanted to ask you first before spending time on the pull request.
The outcome I observed is important since the discovery went from more than a minute down to a few seconds.
Let me know
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
FYI here is my implementation - just tested succeffully 😃
@frblondin Thanks for sharing your implementation - looks pretty clean. It’s awesome that new AutoFixture API allows you to easily perform such kind of optimizations saving the discovery time! 😃