Skip to content

Conversation

@aaronpowell
Copy link
Member

@aaronpowell aaronpowell commented Nov 11, 2025

Upgrading the tests to use xUnit v3, which is what is used by aspire now too.

Close #961

Copilot AI and others added 19 commits November 6, 2025 05:00
… but the MassTransit.ActiveMQ package isn't updated yet

Tracked: MassTransit/MassTransit#6133
@aaronpowell aaronpowell self-assigned this Nov 11, 2025
@aaronpowell aaronpowell added the awaiting response Waiting for the author of the issue to provide more information or answer a question label Nov 11, 2025
Base automatically changed from copilot/add-dotnet-10-tfm-support to main November 15, 2025 20:52
- name: Run tests
run: >-
dotnet test ${{ github.workspace }}/${{ env.TEST_PROJECT_PATH }}
dotnet run ${{ github.workspace }}/${{ env.TEST_PROJECT_PATH }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to:

  1. Remove --logger "console;verbosity=normal".
  2. Replace --logger trx with --report-trx (and ensure Microsoft.Testing.Extensions.TrxReport is referenced)
  3. Replace all the blame-related args with --crashdump, --hangdump, and --hangdump-timeout 7m
  4. --results-directory is changing the meaning a little bit with this PR. Previously it would be relative to current working directory ${{ github.workspace }} while with this PR it will be relative to the test executable. So either pass the full path, or keep using dotnet test which will handle the path transformation for you.
  5. --collect "XPlat Code Coverage" needs to be replaced with --coverage (and ensure Microsoft.Testing.Extensions.CodeCoverage is referenced)

--report-trx
--report-trx-filename "${{ matrix.name }}-${{ matrix.os }}.trx"
--ignore-exit-code 8
-- RunConfiguration.CollectSourceInformation=true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed.

<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.3" />
<PackageVersion Include="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.24568.1" />
<PackageVersion Include="xunit.v3" Version="3.2.0" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is now xunit.v3.mtp-v2 package.

<PackageVersion Include="xunit.v3" Version="3.2.0" />
<PackageVersion Include="xunit.v3.assert" Version="3.2.0" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no longer needed if you don't care about VSTest support.

<RunConfiguration>
<!-- Filter out failing (wrong framework, platform, runtime or activeissue) tests -->
<TestCaseFilter>category!=unsupported-platform</TestCaseFilter>
<TestCaseFilter>category!=failing</TestCaseFilter>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runsettings isn't supported with MTP.

https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-exit-codes -->
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) --ignore-exit-code 8</TestRunnerAdditionalArguments>

<!-- <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncomment?

Copy link

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to also update global.json to specify the test runner as MTP, and probably ensure it requires .NET 10.

@Evangelink
Copy link

@aaronpowell please feel free ping @Youssef1313 or I so we can move forward here.

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

Labels

awaiting response Waiting for the author of the issue to provide more information or answer a question

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade xUnit to v3

4 participants