Fix xunit.v3 test discovery and code coverage in CI (dotnet test / VSTest incompatibility) - #4
Conversation
Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
|
@copilot Thats great, now
|
…rthy info from upstream Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
Done in da1e0d4. Here's what changed: README improvements:
Tests:
|
|
@copilot Looks like the build is failing becasue our VIZ app must target windows only can you fix that? |
…ject Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
…est-comment Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
… in CI Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
|
Now both builds fail in the step to report on code coverage with |
…t.v3 runner Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
Fixed in d5b7afe. Root cause: Switched to |
SummarySummary
CoverageCDT.Core - 85.8%
|

xunit.v3runs via the Microsoft Testing Platform (MTP) in-process runner;dotnet testdefaults to VSTest discovery, which cannot see MTP-hosted tests — producing "No test is available" and, consequently, 0% coverage from an empty run.CDT.Tests.csprojTwo MSBuild properties wire up the MTP pipeline end-to-end:
Both are required — the first fixes the MSBuild/
dotnet testside, the second fixes the runner side. Either one alone is insufficient.coverlet.collectorwas also replaced withcoverlet.msbuild. The collector variant hooks into VSTest'sIDataCollectorAPI which MTP bypasses entirely, leaving the coverage XML file unwritten (hence ReportGenerator failing with "no matching files").coverlet.msbuildrewrites IL at build time and is runner-agnostic..github/workflows/ci-cd.ymlThe Test steps were updated to use
coverlet.msbuildMSBuild properties instead of the VSTest-only--collect:"XPlat Code Coverage"argument:The ReportGenerator input path was updated to match the workspace-absolute output location.
💡 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.