-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable unit tests to run in parallel #3007
Comments
From this issue, via @dodexahedron: We should consider leveraging Nunit as part of addressing THIS Issue.
|
Some of this has been mentioned, but I'm just putting more words and detail to stuff. These are some options available: Split up the test projectFirst idea, which is independent of whether test framework changes or not, is to split the test project up into 2 projects - one for anything that actually requires firing up an Application, and the other for everything else. Pros:
Cons:
Multiple test runner configurationsSecond idea is also independent of any others and thus can be used with or without any other strategy, regardless of framework. Different configurations can be used within a single test project in any framework through use of things such as the Using this option, test classes or methods that require Application setup and teardown could be marked as such, or those that don't could be marked, or both. Then, either test runner configuration files (such as different copies of the xunit.runner.json file), This is a very flexible option and isn't all-or-nothing, and I think it's a prudent strategy to implement no matter which framework is in use or what other ideas we choose to implement. Pros:
Cons (these are super-minor, but I wanted to come up with something):
|
Love. How about
Then, we can all start migrating tests. ?? |
Hahaha Well... I'm trying to take it slow. As I mentioned in the other issue, tests are just code and anything doable in one framework is doable in another or even without a test framework, if one writes the necessary code. For right now, and for the PR I'll put in for the Color stuff, I'm still using XUnit. Fewer changes are still a nice thing to strive for when possible. But yes, if we want to split anything up, vis-a-vis project or framework, that action plan sounds great. I'd offer that, if we do use NUnit for stuff, I'll be happy to shoulder most or all of the burden for conversion, since I catalyzed that initiative. 😅 |
And also, another key is I don't want to distract from work on the actual library itself. Hence why I'm happy to lighten the load if any changes to framework are settled on. |
Oops. I mis-typed above. I wrote xunit, but mean nunit. I've edited it to be correct. |
Huh. I didn't even notice that and my brain filled in "NUnit" the first time, anyway. 😅 |
Running the unit tests on a fast machine can take upwards of 3 minutes. Runs in Github Action can take even longer. This is annoying and slows development.
The reason the unit tests are forced to run serially (
"parallelizeTestCollections": false,
) is primarily becauseApplication
is a singleton.However, over time I've worked hard to make as many unit tests (and code) independent of
Application
.We should create another xunit test project (
Low-level UnitTests
?) that has"parallelizeTestCollections": true,
and move any test that is independent ofApplication
(or otherstatic
s) there.The text was updated successfully, but these errors were encountered: