Force xUnit.net to run tests serially

Force to run tests in test projects serially; (for integration or ui type of tests)
Add this to the xunit test project app.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
...
<add key="xunit.methodDisplay" value="method" />
<add key="xunit.parallelizeAssembly" value="false" />
<add key="xunit.parallelizeTestCollections" value="false" />
<add key="xunit.maxParallelThreads" value="1" />
...

docs:
https://xunit.github.io/docs/configuring-with-xml.html (.NET)
https://xunit.github.io/docs/configuring-with-json.html (.NET core)

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *