Skip to content

New NUnit runner for Microsoft.Testing.Platform#3387

Closed
christophwille wants to merge 5 commits intomasterfrom
feature/mts
Closed

New NUnit runner for Microsoft.Testing.Platform#3387
christophwille wants to merge 5 commits intomasterfrom
feature/mts

Conversation

@christophwille
Copy link
Copy Markdown
Member

@christophwille christophwille commented Feb 3, 2025

@christophwille
Copy link
Copy Markdown
Member Author

christophwille commented Feb 3, 2025

Issue to watch out for: coverlet-coverage/coverlet#1715

- name: Execute unit tests

We don't collect code coverage data anyways, so this is more or less a non-issue.

@christophwille
Copy link
Copy Markdown
Member Author

christophwille commented Feb 8, 2025

CI uses

dotnet test --logger "junit;LogFileName=${{ matrix.configuration }}.xml" --results-directory test-results $env:Tests1 $env:Tests2 $env:Tests3

What are the respective equivalents for MTS?

See this thread on -logger: https://bsky.app/profile/tyrrrz.me/post/3liep5xqqy22q plus issue Tyrrrz/GitHubActionsTestLogger#41 (comment)

Edit: https://github.com/Tyrrrz/GitHubActionsTestLogger might be an option to add as well.


<IsPackable>false</IsPackable>
<StartupObject>AutoGeneratedProgram</StartupObject>
<IsTestProject>true</IsTestProject>
Copy link
Copy Markdown
Contributor

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.

<IsPackable>false</IsPackable>
<StartupObject>AutoGeneratedProgram</StartupObject>
<IsTestProject>true</IsTestProject>
<EnableNUnitRunner>true</EnableNUnitRunner>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I advise moving this to Directory.Build.props

@Youssef1313
Copy link
Copy Markdown
Contributor

Youssef1313 commented Mar 15, 2025

@christophwille Is it necessary to use junit test results format, or could you switch to TRX? Also, I'm not sure why you are passing individual dlls with $env:Tests1 etc. Why not simply run dotnet test on the whole solution? Like this:

dotnet test -- --report-trx --results-directory test-results

Note 1: You will need Microsoft.Testing.Extensions.TrxReport NuGet package for --report-trx to work.

Note 2: The extra -- will not be needed in the new dotnet test experience that is planned for .NET 10.

Small note: the abbreviation is MTP (Microsoft.Testing.Platform) not MTS

@christophwille
Copy link
Copy Markdown
Member Author

@christophwille Is it necessary to use junit test results format, or could you switch to TRX?

- name: Create Test Report

@Youssef1313 back in the day (at least) that was the reason (didn't check if that still is not trx-friendly). That is also the comment re:GitHubActionsTestLogger as a potential replacement.

@Youssef1313
Copy link
Copy Markdown
Contributor

Hmm, yeah looks like this GitHub Action doesn't support TRX: test-summary/action#1

@Youssef1313
Copy link
Copy Markdown
Contributor

I started a PR for the testlogger so that it supports JUnit reporter for MTP spekt/testlogger#172. Let's see if this can get merged soon, assuming the work is approved by the maintainer.

@christophwille christophwille deleted the feature/mts branch July 7, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants