Nunit-console: Run tests in parellel based on property or specify it to console runner to not run in parallel

Created on 2 Oct 2017  路  3Comments  路  Source: nunit/nunit-console

Hello,

I am using nunit to run my Selenium tests and running the fixtures in parallel work great when using Chrome and Firefox headless but when I run IE it can't due to it not a headless browser. Is there an easy way to tell nunit to not run in parallel by passing a parameter to the console runner? I am guessing I can't really do this in code since the attribute is added during compilation.

My only option I can think of is building the project twice, once with parallel enabled and another without.

question

Most helpful comment

Passing --workers=1 will run the parallel dispatcher with only one MTA background worker. If some tests run in the STA, they may execute at the same time as a parallel test in the MTA. If that occurs, using --workers=0 will force pure sequential execution. A better alternative is probably to ensure that all STA tests are non-parallel.

All 3 comments

I believe passing --workers=1 should limit the parallelism to using a single worker thread, and therefore run everything sequentially. 馃檪

Passing --workers=1 will run the parallel dispatcher with only one MTA background worker. If some tests run in the STA, they may execute at the same time as a parallel test in the MTA. If that occurs, using --workers=0 will force pure sequential execution. A better alternative is probably to ensure that all STA tests are non-parallel.

Awesome that is exactly what I needed! Thanks!

Was this page helpful?
0 / 5 - 0 ratings