Skip to content

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

Open

Description

@ViktorHofer

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

Activity

  1. added
    untriaged
    on Jun 16, 2020
  2. removed
    untriaged
    on Jul 8, 2020
  3. added this to the 5.0.0 milestone on Jul 8, 2020
  4. self-assigned this
    on Jul 30, 2020
  5. ViktorHofer commented on Aug 4, 2020

    @ViktorHofer
    MemberAuthor

    Blocked until 5.0 P8 SDK is released.

  6. modified the milestones: 5.0.0, 6.0.0 on Aug 26, 2020
  7. tmds commented on Sep 23, 2020

    @tmds
    Member

    I'm interested in this because it will make long running tests produce a coredump.
    On our rhel8 arm64 CI machine, occasionally we see some long running tests, and having these coredumps will help debug them.

  8. tmds commented on Oct 12, 2020

    @tmds
    Member

    @ViktorHofer is this something you'll be working on short term? I've been ignoring failures from long running tests on our arm64 rhel8 ci machine because having coredumps from vstest will make it easier to debug them.

  9. ViktorHofer commented on Oct 12, 2020

    @ViktorHofer
    MemberAuthor

    @tmds #39923 is finally ready. It should be merged as soon as I discussed the new device bring-up scenario offline with my colleagues.

  10. modified the milestones: 6.0.0, 7.0.0 on Aug 4, 2021
  11. PRIMETSS commented on Nov 23, 2021

    @PRIMETSS
    Contributor

    Spent the last few days trying to get v6 & v5 building locally to look at SerialPort Libs and kept having issue where build seemed to break with open files errors. Traced it to xunit.console.exe is not terminating if run dotnet build /t:test
    Seems related to https://github.com/xunit/xunit/issues/1811 Cant even KILL the process, have to reboot!
    Begs the question, how does one Test Libs LOCALLY?? Is everyone using the CI only? (guess it runs in Container and gets wiped out each build cycle so runs clean?) Will try JUST using VS to run tests, as this might work if you dont mix running tests in CLI.
    Just baffled how this isn't a more common question? (me?)

  12. removed their assignment
    on Jul 20, 2022
  13. added
    blocked
    on Jul 20, 2022
  14. ViktorHofer commented on Jul 20, 2022

    @ViktorHofer
    MemberAuthor
  15. modified the milestones: 7.0.0, Future on Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-librariesblockeddev-innerloop

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions