Skip to content

Unit tests ignore xunit.runner.json - Explains why the new stopOnFail setting wasn't working #2769

@tig

Description

@tig

See xunit/visualstudio.xunit#189

Fix is to set xunit.runner.json to Copy On Newer:

image

(Adding this to UnitTests.csproj:

  <ItemGroup>
    <Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

We can remove this line from ./UnitTests/AssemblyInfo.cs (it WAS what was preventing tests from running in parallel, but is no longer needed if xunit.runner.json is working):

// Since Application is a singleton we can't run tests in parallel
[assembly: CollectionBehavior (DisableTestParallelization = true)]

Once this is done, stopOnFail can be enabled by adding "stopOnFail": true to xunit.runner.json.

I'd like to know if anyone has an objection to setting stopOnFail to true. I'd DEF want this for CI/CD, but am not sure if I like it for dev work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-and-deployIssues regarding to building and deploying Terminal.GuitestingIssues related to testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions