I've got a large acceptance test (~10 seconds per test) test suite written using NUnit. I would like to make use of the fact that my machines are all multiple core boxes. Ideally, I'd be able to have one test running per core, independently of other tests.
There is PNUnit, but it's designed for testing for threading synchronization issues and things like that, and I didn't see an obvious way to accomplish this.
Is there a switch/tool/option I can use to run the tests in parallel?
You can parallel test at scale by integrating test automation frameworks with a cloud-based solution, which takes care of device management. The opposite of parallel testing is sequential testing. This entails executing one test after another. This is a much more time-consuming approach to testing.
Visual Studio 2019 runs unit tests sequentially when it is suppose to run them in parallel. Click on the Run Tests in Parallel button in Test Explorer. Make sure the icon is highlighted.
Running unit tests in parallel can significantly improve the speed at which they run. However, you have to make sure that one test does not affect another in any way. Else your tests are green most of the time, but sometimes one or more tests will fail. Both tests depend on IRepository .
If you want to run NUnit tests in parallel, there are at least 2 options:
NUnit version 3 will support running tests in parallel:
Adding the attribute to a class: [Parallelizable(ParallelScope.Self)] will run your tests in parallel.
• ParallelScope.None indicates that the test may not be run in parallel with other tests.
• ParallelScope.Self indicates that the test itself may be run in parallel with other tests.
• ParallelScope.Children indicates that the descendants of the test may be run in parallel with respect to one another.
• ParallelScope.Fixtures indicates that fixtures may be run in parallel with one another.
NUnit Framework-Parallel-Test-Execution
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With