Skip to content

Fix Specs coverage in CI builds and raise VerificationGlue to 0.5.0-preview.1 - #140

Merged
ipjohnson merged 1 commit into
mainfrom
agent/stp-vgdm-coverage-fix
Nov 27, 2026
Merged

ipjohnson merged 1 commit into
mainfrom
agent/stp-vgdm-coverage-fix

Conversation

@ipjohnson

Copy link
Copy Markdown
Owner

What changed

scripts/test-verificationglue.sh builds the VerificationGlue.Tests projects with -p:DeterministicSourcePaths=false when it runs them under coverlet.console. The DependencyModules.Specs report now has real figures in CI. Before, its module table was empty and Total was 0%.

VerificationGlueVersion in Directory.Build.props is now 0.5.0-preview.1. That brings Microsoft.Testing.Platform 3.0.0-preview.26566.9. Nothing else needed changing.

Why

CI sets ContinuousIntegrationBuild=true, which writes /_/... source paths into the PDBs. coverlet.console finds no local source for any module and skips them all. The VSTest suites avoid this because coverlet.collector's build targets write a CoverletSourceRootsMapping_<assembly> file. coverlet.console 6.0.2 and 10.1.1 both ignore that file, even with the collector's targets imported into the Specs project. I tried that and it still reported 0%. coverlet.MTP 10.1.1 and Microsoft.Testing.Extensions.CodeCoverage 18.12.0 both depend on Microsoft.Testing.Platform 2.x, and the Specs app runs MTP 3.0 preview, so I did not use either.

The property also rebuilds the referenced src projects without deterministic paths. Later CI steps do not reuse those outputs, because verify-packages.sh packs without --no-build.

This unblocks #137 and #138, whose moved tests counted as 0% in CI. In CI run 45927930614 for #137, merged coverage was 68.4%.

How it was tested

Every run below set GITHUB_ACTIONS=true, so the builds were CI builds.

  • Without the fix, a CI build of the Specs project under coverlet gives an empty module table and 0%, the same as CI.
  • On this branch, dotnet csharpier check ., scripts/coverage.sh, scripts/test-xunit.sh 4 and scripts/verify-packages.sh all pass. The Specs project runs 124 tests. Its report covers DependencyModules.Runtime at 45.5%, the code its RuntimeTests exercise. The other modules are at 0%, because main's Specs tests do not reach them.
  • The merged figure on this branch is 92.7%, covering 8920 of 9615 lines. On 734074c, the commit before the Specs project existed, the figure is the same.
  • PR Move the GeneratorTests files A to M to DependencyModules.Specs #137's head was run with only this branch's test-verificationglue.sh laid over it, from a detached checkout of the fetched ref. Its branch was not changed. The Specs project runs 889 tests, and its report covers SourceGenerator at 90.4% and Runtime at 92.4%. The merged figure stays at 92.7% (8920 of 9615 lines), so moving tests into the Specs project no longer lowers it.

That run used VerificationGlue 0.3.0-preview.1, PR #137's version. I did not run #137 or #138 on 0.5.0-preview.1, and I did not change either branch.

🤖 Generated with Claude Code


Opened by Agent Driver for step stp-vgdm-coverage-fix of Task tsk-verificationglue.

…review.1

coverlet.console does not read the CoverletSourceRootsMapping file, so the
/_/ source paths of a ContinuousIntegrationBuild left it no local sources
and it skipped every module. The coverage build now keeps real source paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ipjohnson
ipjohnson merged commit 2e91660 into main Nov 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant