nunit / nunit-console

NUnit Console runner and test engine
MIT License
215 stars 152 forks source link

Use framework prefilter for massive perf improvement when running fraction of tests #438

Open jnm2 opened 6 years ago

jnm2 commented 6 years ago

Following up from https://github.com/nunit/nunit/issues/2867: Skipping TestCaseSource invocation for tests outside the filter is not as intensely obvious for the console runner as it is for the VS adapter, since I tend to use the console for larger fractions of tests. However, there will still be noticeable time savings in our build scripts at work.

@CharliePoole has introduced discovery-time filtering in the framework and integrated with it in the NUnitLite runner. This pattern should be easy to follow in all the other runners: https://github.com/nunit/nunit/pull/2878

For @oznetmaster, this has resulted in roughly a 12x performance boost: https://github.com/nunit/nunit/pull/2878#issuecomment-404009088.

There's a possibility that this is also going to hold up the same enhancement in the adapter, which relies on the engine in this repo: https://github.com/nunit/nunit3-vs-adapter/issues/529. Is this something we'd be willing to ship in the next console release without waiting for the framework's next release?

CharliePoole commented 6 years ago

See my comment on nunit/nunit3-vs-adapter#529

CharliePoole commented 2 years ago

Need to review this and decide whether to include in 4.0, postpone or close.