You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Coverage reports collide across test projects with relative --coverage-output (regression in 18.9.0) #226
Upgrading from 18.8.0 to 18.9.0, multiple test projects in one dotnet test
solution run now write coverage to the same shared TestResults folder instead
of their own project folder. With a relative --coverage-output path, they
overwrite each other and coverage data is lost.
Cause: transitively bumps Microsoft.Testing.Platform 2.2.3 → 2.3.0, which now
honors DOTNET_CLI_TEST_COMMAND_WORKING_DIRECTORY (set by dotnet test to the
solution root) when resolving the results directory.
Minimal repro attached (repro.zip): two independent test projects, run.ps1
runs both versions and reports the coverage file count.
18.8.0: 2 coverage files (one per project) — correct
18.9.0: 1 file — projects clobbered each other
Expected: each project gets its own report regardless of that env var.
Env: .NET SDK 10.0.301, Microsoft.Testing.Platform (MTP), xUnit v3, Windows 11.
I noticed the same. But the change is really, that everything now ends up in a single .\TestResults folder. And if you use --coverage-output, then that is what makes them overwrite each other.
So, (as I understand it):
Old behavior (<= 18.8.0): each result ended up in a separate directory and setting for example --coverage-output coverage.cobertura.xml would name both files the same, but in different directories.
New Behavior (>= 18.9.0): each result ends up in the same directory (configurable with --results-directory), but with different file names (unless configured with --coverage-output.
In any case. The problem happens if you use both --coverage-outputand you have multiple test projects.
I noticed the same. But the change is really, that everything now ends up in a single .\TestResults folder. And if you use --coverage-output, then that is what makes them overwrite each other.
So, (as I understand it):
Old behavior (<= 18.8.0): each result ended up in a separate directory and setting for example --coverage-output coverage.cobertura.xml would name both files the same, but in different directories.
New Behavior (>= 18.9.0): each result ends up in the same directory (configurable with --results-directory), but with different file names (unless configured with --coverage-output.
In any case. The problem happens if you use both --coverage-outputand you have multiple test projects.
Yes, this is the new behavior. If you run dotnet test something.slnx --report-trx --report-trx-filename anything.trx and it will yield the same result as well.
Update: Xunit's own trx reporter also faces similar issue with dotnet test something.slnx --report-xunit-trx --report-xunit-trx-filename', 'something.trx.
Activity
dorssel commentedon Jul 9, 2026
I noticed the same. But the change is really, that everything now ends up in a single
.\TestResultsfolder. And if you use--coverage-output, then that is what makes them overwrite each other.So, (as I understand it):
--coverage-output coverage.cobertura.xmlwould name both files the same, but in different directories.--results-directory), but with different file names (unless configured with--coverage-output.In any case. The problem happens if you use both
--coverage-outputand you have multiple test projects.dorssel commentedon Jul 9, 2026
Exactly this commit is what fixed it for me: dorssel/dotnet-debounce@07e26d3
fhnaseer commentedon Jul 10, 2026
Yes, this is the new behavior. If you run
dotnet test something.slnx --report-trx --report-trx-filename anything.trxand it will yield the same result as well.Update: Xunit's own trx reporter also faces similar issue with
dotnet test something.slnx --report-xunit-trx --report-xunit-trx-filename', 'something.trx.tsondergaard commentedon Jul 10, 2026
fhnaseer, so this behaviour change is here to stay?
--coverage-outputseems like a dangerous option with the new behaviour.fhnaseer commentedon Jul 10, 2026
You can still do
mtp.test1.exe --coverage --coverage-output something.coveragefor a deterministic output.MTP introduced placeholder names (not supported in coverage extension though yet) to have deterministic names on solution level https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-test-reports#report-file-names.
tsondergaard commentedon Jul 13, 2026
Okay, it's intentional. I'll close the issue then.
Add dotnet test --results-directory-layout for MTP runs
Add dotnet test --results-directory-layout for MTP runs