简体   繁体   中英

Running unit tests in parallel in teamcity?

what is the best way to run unit tests in parallel in teamcity for a C# project?

I can run the tests using MsTest or NUnit or whatever, I just need a way to run the tests in parallel to cut down on execution time.

Teamcity does not execute tests in parallel and there is no option do activate such a feature in the default NUnit test runner.

However, NUnit contains PNunit since version 2.5, so you can use PNUnit to create unit tests that run in parallel and you can run them in teamcity using the console test runner. So if you really need parallel execution for your tests for any reasons, you have to change your test implementations to support it.

For details, take a look at the NUnit release notes and the PUnit website:

You can do it this way. But please note that the makers of PNunit say: "PNUnit is not intended for "casual" parallelism merely to make the tests run faster. Rather, it's intended as a way to test applications composed of distributed, communicating components."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM