Skip to content

Remove xunit.console and make VSTest the default runner both locally and in CI #37953

Open

Description

Today we support two different test runners: xunit.console and VSTest. The former is used when invoking the test target dotnet msbuild /t:Test and when running on CI. The latter is used when using VS Test Explorer, F5, the dotnet msbuild /t:Run target or when invoking dotnet test. To leverage the new crash dump / hang dump features that @davidfowl is driving in partnership with the VSTest team (cc @nohwnd), we should switch to VSTest and remove xunit.console entirely.

This issue only tracks the libraries side for non-mobile and non-WASM configurations. Mobile and WASM use a different harness called xharness which is out-of-scope at the moment.

  1. Remove xunit.console:
  1. Remove runner templates for non-mobile and non-wasm:
  1. Revert 85bfbfc#diff-e7bc39410f7a119e7adb69b17006c452

  2. Condition the RunTemplate and Test target logic on TargetsMobile and WASM:

  1. Use dotnet test in CI instead of RunTests.cmd/sh for non-mobile and non-wasm:
  • <HelixCommand Condition="'$(TargetOS)' == 'Windows_NT'">call RunTests.cmd --runtime-path %HELIX_CORRELATION_PAYLOAD%</HelixCommand>
    <HelixCommand Condition="'$(TargetOS)' != 'Windows_NT'">./RunTests.sh --runtime-path "$HELIX_CORRELATION_PAYLOAD"</HelixCommand>
  1. Fix failing tests (ie Microsoft.Extensions.DependencyModel.Tests) and make sure that code coverage works.

  2. Optional: use dotnet publish instead of the ArchiveTests target:

cc @Anipik @ericstj @safern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions