No parallel tests with xUnit DNX

I try to run my tests one by one, without parallel.

I tried to configure this in my xunit.runner.jsonfile, but to no avail:

{
  "maxParallelThreads": 1,
  "parallelizeAssembly": false,
  "parallelizeTestCollections": false,
  "preEnumerateTheories": false
}

What am I doing wrong?

+4
source share
2 answers

I'm on the dnx 1.0.0-rc1-final, xunit 2.1.0, xunit.runner.dnx 2.1.0-rc1-build204, and the option maxParallelThreadsto xunit.runner.jsonwork for me from the command line.

Do you have your tests shared by collections? According to the documents :

By default, each test class is a unique test collection.

Therefore, given some far-fetched โ€œtestsโ€ like these, it should be easy to see if they work in parallel or not:

FROM

{
    "diagnosticMessages": true,
    "maxParallelThreads":  4
}

image

FROM

{
    "diagnosticMessages": true,
    "maxParallelThreads":  1
}

image

+7

, parallelism .net core ( >= 2.1):

xunit.runner.json :

{
  "parallelizeAssembly": false,
  "parallelizeTestCollections": false
}

csproj:

  <ItemGroup>
    <None Update="xunit.runner.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

.

0

Source: https://habr.com/ru/post/1615104/


All Articles