Fix xunit.v3+MTP CI: Data.Tests zero-tests-ran exit code and missing TRX report files#299
Draft
Copilot wants to merge 12 commits intofeature/bump_xunit_v3from
Draft
Fix xunit.v3+MTP CI: Data.Tests zero-tests-ran exit code and missing TRX report files#299Copilot wants to merge 12 commits intofeature/bump_xunit_v3from
Copilot wants to merge 12 commits intofeature/bump_xunit_v3from
Conversation
Copilot
AI
changed the title
[WIP] Investigate missing TRX file generation in XUnit upgrade
Fix TRX generation for xunit.v3 in CI
Mar 16, 2026
Copilot
AI
changed the title
Fix TRX generation for xunit.v3 in CI
Fix xunit.v3 TRX generation and simplify CI test step via MTP
Mar 16, 2026
Copilot
AI
changed the title
Fix xunit.v3 TRX generation and simplify CI test step via MTP
Fix TypeLoadException: pin Microsoft.Testing.Extensions.TrxReport to 1.9.1
Mar 16, 2026
Copilot
AI
changed the title
Fix TypeLoadException: pin Microsoft.Testing.Extensions.TrxReport to 1.9.1
Fix xunit.v3+MTP CI: Data.Tests zero-tests-ran exit code and missing TRX report files
Mar 17, 2026
6222f85 to
01f579f
Compare
e91b8cc to
bdbf07c
Compare
958d05f to
06697d9
Compare
9873a85 to
43322ce
Compare
xunit.v3 test projects use OutputType=Exe and the xUnit in-process runner, which does not integrate with `dotnet test` via VSTest. The old command `dotnet test --logger "trx;..."` didn't discover or run any tests. Run each test executable directly with `-trx TestResults/<name>.trx` to generate TRX report files that dorny/test-reporter can consume. Co-authored-by: Atrejoe <585091+Atrejoe@users.noreply.github.com>
- Downgrade Microsoft.Testing.Extensions.TrxReport from 2.1.0 to 1.9.1 in
all 3 test projects, aligning all Microsoft.Testing.* packages at 1.9.1
(required for compatibility with xunit.v3.core.mtp-v1 3.2.2 which uses MTP 1.x)
- Regenerate packages.lock.json for all 3 test projects
- Replace complex shell loop in workflow with single dotnet test command:
dotnet test InkyCal.sln --no-build --configuration Release
-p:TestingPlatformDotnetTestSupport=true
-- --report-trx --results-directory TestResults
- Remove now-redundant Upload Artifact step
- Restore accidentally-changed InkyCal.Server/packages.lock.json to its
original version (Microsoft.AspNetCore.App.Internal.Assets 10.0.4)
Co-authored-by: Atrejoe <585091+Atrejoe@users.noreply.github.com>
…rt to 1.9.1 The package Microsoft.Testing.Extensions.TrxReport 2.1.0 pulls in Microsoft.Testing.Platform 2.1.0, but xunit.v3.core.mtp-v1 3.2.2 hard-requires MTP 1.9.1 (the '-mtp-v1' suffix means it only supports Microsoft Testing Platform v1). Loading both causes a TypeLoadException at runtime. Downgrade Microsoft.Testing.Extensions.TrxReport to 1.9.1 in all 3 test projects to align all Microsoft.Testing.* packages at the version that xunit.v3 3.2.2 requires. Co-authored-by: Atrejoe <585091+Atrejoe@users.noreply.github.com>
Two CI failures after the xunit.v3 MTP mode migration:
1. InkyCal.Data.Tests: when no SQL database is reachable in CI,
all 11 tests are skipped via SkipException. xunit.v3+MTP reports
"Zero tests ran" and exits with code 1, failing the CI step.
Fix: add ConfigurationTests.ConnectionStringIsConfigured which
always passes (only reads appsettings.json, no DB required),
ensuring MTP always has >=1 passing test.
2. TRX files not found: --results-directory TestResults (relative)
resolves to {ProjectDir}/bin/Release/net10.0/TestResults/ when
running via solution, so dorny/test-reporter's TestResults/*.trx
glob finds nothing.
Fix: change to --results-directory $GITHUB_WORKSPACE/TestResults
(absolute) so all TRX files land at the repo root TestResults/.
Co-authored-by: Atrejoe <585091+Atrejoe@users.noreply.github.com>
06697d9 to
3e10517
Compare
…estLogger The failing CI run 24030058316 showed: TypeLoadException: Could not load type 'Microsoft.Testing.Platform.Extensions.TestHost.IDataConsumer' from assembly 'Microsoft.Testing.Platform, Version=2.1.0.0' Root cause: Microsoft.Testing.Platform.MSBuild 1.9.1 (from xunit.runner.visualstudio 3.1.5) tried to access IDataConsumer from Microsoft.Testing.Platform 2.1.0, where that interface was removed. A secondary CS1705 build error came from XunitXml.TestLogger 8.0.0 being compiled against Microsoft.Testing.Platform 2.0.2 while NuGet resolved the package to 1.9.1. Fixes: - Downgrade Microsoft.Testing.Extensions.TrxReport 2.1.0 → 1.9.1 in all 3 test projects - Remove explicit Microsoft.Testing.Platform 2.1.0 references (now consistently resolved to 1.9.1 via transitive deps) - Remove XunitXml.TestLogger 8.0.0 from InkyCal.Utils.Tests (unused in CI workflow, caused MTP version conflict) - Updated package lock files accordingly Agent-Logs-Url: https://github.com/Atrejoe/Inky-Calendar-Server/sessions/533bb318-89b2-4c08-956d-959f4d5e4243 Co-authored-by: Atrejoe <585091+Atrejoe@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



TypeLoadException: Could not load type 'IDataConsumer' from Microsoft.Testing.Platform 2.1.0—Microsoft.Testing.Platform.MSBuild 1.9.1(fromxunit.runner.visualstudio 3.1.5) is incompatible withMicrosoft.Testing.Platform 2.1.0XunitXml.TestLogger 8.0.0was compiled against MTP 2.0.2 but MTP 1.9.1 was resolved — withTreatWarningsAsErrors, this caused a build failureMicrosoft.Testing.Extensions.TrxReport2.1.0 → 1.9.1 in all 3 test projectsMicrosoft.Testing.Platform 2.1.0references (now resolves transitively to 1.9.1)XunitXml.TestLogger 8.0.0fromInkyCal.Utils.Tests(unused in CI workflow, caused version conflict)packages.lock.jsonfiles💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.