Skip to content

.NET 10 MTP dotnet test#3507

Merged
christophwille merged 5 commits intomasterfrom
christophwille/net10mtp
Jul 8, 2025
Merged

.NET 10 MTP dotnet test#3507
christophwille merged 5 commits intomasterfrom
christophwille/net10mtp

Conversation

@christophwille
Copy link
Copy Markdown
Member

@christophwille christophwille commented Jul 7, 2025

@christophwille
Copy link
Copy Markdown
Member Author

christophwille commented Jul 7, 2025

Local output:

  In process file artifacts produced:
    - ILSpy.Tests\bin\Debug\net10.0-windows\TestResults\test-results.trx
    - ILSpy.BamlDecompiler.Tests\bin\Debug\net10.0-windows\win-x64\TestResults\test-results.trx
    - ICSharpCode.Decompiler.Tests\bin\Debug\net10.0-windows\win-x64\TestResults\test-results.trx

Test run summary: Passed!
  ILSpy.Tests\bin\Debug\net10.0-windows\ILSpy.Tests.exe (net10.0|x64) passed (1s 590ms)
  ICSharpCode.Decompiler.Tests\bin\Debug\net10.0-windows\win-x64\ICSharpCode.Decompiler.Tests.exe (net10.0|x64) passed (9m 45s 002ms)
  ILSpy.BamlDecompiler.Tests\bin\Debug\net10.0-windows\win-x64\ILSpy.BamlDecompiler.Tests.exe (net10.0|x64) passed (2s 708ms)

  total: 2685
  failed: 0
  succeeded: 2672
  skipped: 13
  duration: 9m 46s 681ms

Previously, a single trx file was created. @Youssef1313 is it possible like before to create a single trx for the entire dotnet test run?

@Youssef1313
Copy link
Copy Markdown
Contributor

So far we don't have post-processing of artifacts, so it's a TRX per test assembly. But you could search for tools out there that merges TRX files, you may be able to find some third-party tools that do it.

@christophwille
Copy link
Copy Markdown
Member Author

christophwille commented Jul 7, 2025

So far we don't have post-processing of artifacts, so it's a TRX per test assembly. But you could search for tools out there that merges TRX files, you may be able to find some third-party tools that do it.

I switched to --results-directory - but the files are named quite ugly

  In process file artifacts produced:
    - test-results\christophw_ZORT_2025-07-07_09_14_52.226.trx
    - test-results\christophw_ZORT_2025-07-07_09_14_52.910.trx
    - test-results\christophw_ZORT_2025-07-07_09_23_12.688.trx

Is there a way to include the project name?

@Youssef1313
Copy link
Copy Markdown
Contributor

@christophwille We don't yet have placeholders for --report-trx-filename, BUT, you can still definitely achieve it. Something in Directory.Build.props like this:

<PropertyGroup Condition="'$(UseReportTrx)' == 'true'">
    <TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-trx --report-trx-filename $(MSBuildProjectName)</TestingPlatformCommandLineArguments>
</PropertyGroup>

Then test with dotnet test -p:UseReportTrx=true

Note I'm writing directly on GitHub so I could have errors.

@christophwille christophwille marked this pull request as ready for review July 7, 2025 09:53
@christophwille
Copy link
Copy Markdown
Member Author

christophwille commented Jul 7, 2025

@siegfriedpammer is it a problem if the test-results files have funky names? I mean we know the biggest one is from ics.d.

@christophwille christophwille requested a review from Copilot July 7, 2025 09:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for .NET 10’s Microsoft Testing Platform (MTP) runner, switches from a JUnit logger to a TRX logger, and updates CI to leverage the new dotnet test --report-trx workflow.

  • Register MTP as the dotnet test runner in dotnet.config
  • Update test projects to enable MTP entry points, set runtime identifiers, and replace JunitXml.TestLogger with Microsoft.Testing.Extensions.TrxReport
  • Revise GitHub Actions to invoke dotnet test --report-trx and collect all .trx files

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dotnet.config Added [dotnet.test.runner] section to specify Microsoft.Testing.Platform
ILSpy.Tests/ILSpy.Tests.csproj Enabled MTP, set RIDs, swapped test logger, removed legacy StartupObject
ILSpy.BamlDecompiler.Tests.csproj Mirrored MTP enablement and logger swap
ICSharpCode.Decompiler.Tests.csproj Added GenerateTestingPlatformEntryPoint, MTP props, and TRX logger
Directory.Packages.props Removed JUnit logger package, added TRX logger package, bumped NUnit3TestAdapter
.github/workflows/build-ilspy.yml Switched to dotnet test --report-trx, updated artifact and report patterns
Comments suppressed due to low confidence (1)

.github/workflows/build-ilspy.yml:66

  • The solution filename is referenced as ilspy.sln, but the repository uses ILSpy.sln. This case mismatch can cause failures on case-sensitive runners—update to ILSpy.sln.
      run: dotnet test --solution ilspy.sln --configuration ${{ matrix.configuration }} --no-build --report-trx --results-directory test-results/${{ matrix.configuration }}

Comment thread Directory.Packages.props
Comment thread ILSpy.Tests/ILSpy.Tests.csproj Outdated
Comment thread ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj Outdated
Comment thread ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj Outdated
@siegfriedpammer siegfriedpammer force-pushed the christophwille/net10mtp branch from aa4759e to 1a41fd8 Compare July 8, 2025 05:52
Comment thread ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
@christophwille christophwille merged commit 3fd3071 into master Jul 8, 2025
17 checks passed
@christophwille christophwille deleted the christophwille/net10mtp branch July 8, 2025 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants