Skip to content

Add cross-platform code coverage tooling + CI wiring#990

Open
johnml1135 wants to merge 2 commits into
mainfrom
coverage-tooling-ci
Open

Add cross-platform code coverage tooling + CI wiring#990
johnml1135 wants to merge 2 commits into
mainfrom
coverage-tooling-ci

Conversation

@johnml1135

@johnml1135 johnml1135 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The existing /EnableCodeCoverage MSBuild flag (Build/SetupInclude.targets) depends on a VS-Enterprise-only "Code Coverage" data collector and silently fails to collect on Community/Build Tools installs (confirmed live: vstest.console.exe reports Unable to find a datacollector with friendly name 'Code Coverage').
  • Add coverlet.collector instead, which registers the cross-platform "XPlat Code Coverage" collector and works under plain vstest.console.exe on any VS edition.
  • Add a -Coverage switch to test.ps1 that collects coverage (resolving coverlet's TestAdapterPath from the centrally-pinned package version, same pattern as the existing NUnit adapter lookup) and renders a summary/HTML report via a local ReportGenerator dotnet tool (.config/dotnet-tools.json).
  • Wire -Coverage into CI.yml's test step and upload the rendered report as a build artifact.
  • test.ps1 now runs dotnet tool restore before invoking ReportGenerator so a fresh checkout/CI runner doesn't just warn and skip the report.
  • Add the fieldworks-test-coverage skill (how to check that new/changed lines are actually exercised, not just that a test file exists nearby) and reference it from execute-implement/verify-test and the base rubric's test_coverage criterion.

Test plan

  • .\build.ps1 — full solution build, clean
  • .\test.ps1 -TestProject "Src/Common/FwUtils/FwUtilsTests" -Coverage on this branch (built against plain main, not any feature branch) — 375/375 tests passed, coverage collected and summary/HTML report rendered correctly
  • Confirmed the previous /EnableCodeCoverage flag does not work on a VS 2022 Community install (motivates the coverlet switch)

🤖 Generated with Claude Code


This change is Reviewable

johnml1135 and others added 2 commits July 3, 2026 14:57
The existing /EnableCodeCoverage MSBuild flag (Build/SetupInclude.targets)
depends on a VS-Enterprise-only "Code Coverage" data collector and
silently fails to collect on Community/Build Tools installs (confirmed
live: vstest.console.exe reports "Unable to find a datacollector").

Add coverlet.collector instead, which registers the cross-platform
"XPlat Code Coverage" collector and works under plain vstest.console.exe
on any VS edition. Wire a `-Coverage` switch into test.ps1 that collects
coverage (per-project TestAdapterPath resolved from the centrally-pinned
package version, same pattern as the existing NUnit adapter lookup) and
renders a summary/HTML report via a local ReportGenerator dotnet tool
(.config/dotnet-tools.json).

Add the fieldworks-test-coverage skill (how to check that new/changed
lines are actually exercised, not just that a test file exists nearby)
and reference it from execute-implement/verify-test and the base
rubric's test_coverage criterion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add -Coverage to the CI test.ps1 invocation and upload the rendered
summary/HTML report as a build artifact. Have test.ps1 run
`dotnet tool restore` before invoking ReportGenerator so a fresh
checkout (CI runners, new clones) doesn't just warn and skip the
report because the local tool manifest was never restored.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

NUnit Tests

    2 files  +    1      2 suites  +1   13m 27s ⏱️ + 2m 45s
4 282 tests  -    17  4 161 ✅  -    65   73 💤 ± 0  48 ❌ +48 
7 097 runs  +2 789  6 904 ✅ +2 669  142 💤 +69  51 ❌ +51 

For more details on these failures, see this check.

Results for commit 8d6d6d8. ± Comparison against base commit 906e569.

This pull request removes 17 tests.
LexEdDllTests.CircularRefBreakerTests ‑ BreakCircularEntryRefs
LexEdDllTests.FlexBridgeListenerTests ‑ ConvertFlexNotesToLift_ConvertsRefs
LexEdDllTests.FlexBridgeListenerTests ‑ ConvertLiftNotesToFlex_ConvertsRefs
LexEdDllTests.GoldEticGuidFixerTests ‑ ReplacePOSGuidsWithGoldEticGuids_CustomPosItemsAreUnaffected
LexEdDllTests.GoldEticGuidFixerTests ‑ ReplacePOSGuidsWithGoldEticGuids_EntriesUsingChangingPosAreNotNegativelyAffected
LexEdDllTests.GoldEticGuidFixerTests ‑ ReplacePOSGuidsWithGoldEticGuids_NoChangesReturnsFalse
LexEdDllTests.GoldEticGuidFixerTests ‑ ReplacePOSGuidsWithGoldEticGuids_WrongPosGuidChangedToMatchStandard
LexEdDllTests.GoldEticGuidFixerTests ‑ ReplacePOSGuidsWithGoldEticGuids_WrongPosGuidInWrongPlaceGuidChangedToMatchStandard
LexEdDllTests.LexEntryChangeHandlerTests ‑ FixupKeepDanglingLexEntryRefsWhenComplexEntryTypeExists
LexEdDllTests.LexEntryChangeHandlerTests ‑ FixupRemovesDanglingLexEntryRefs
…

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