Skip to content

Collect managed coverage across CI test workers - #2147

Closed
Tyrie Vella (tyrielv) wants to merge 6 commits into
microsoft:masterfrom
tyrielv:tyrielv/aot-coverage-probe
Closed

Tyrie Vella (tyrielv) wants to merge 6 commits into
microsoft:masterfrom
tyrielv:tyrielv/aot-coverage-probe

Conversation

@tyrielv

@tyrielv Tyrie Vella (tyrielv) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem and Context

CI runs unit, functional, and upgrade tests, but it does not publish managed-source coverage or changed-line reports. Reviewers cannot use those results to determine which changed lines tests execute.

The functional suite uses twelve workers per architecture. Coverage collection must use those existing runs without another test suite.

Some unit tests compile product source into the test assembly. A useful report must distinguish execution in those copies from execution in the NativeAOT product.

Changes

  • Instrument the NativeAOT payloads in the existing x64 and ARM64 PR-validation and CI builds.
  • Collect coverage during the existing unit runs, 24 functional shards, and six upgrade scenarios. Preserve their worker matrix and test selections.
  • Use the Visual Studio collector to capture real Windows-service execution, with collector access for LocalSystem.
  • Include the compiled source revision, architecture, and collector session with installer artifacts. Use this manifest to select the matching source and session for reused drops.
  • Require all 32 worker reports before the aggregate report claims complete test-run evidence. Reject missing or duplicate workers, mixed revisions, failed worker outcomes, and empty coverage.
  • Map build-machine source paths to the tested checkout. Exclude generated and external documents explicitly.
  • Publish separate source-level reports for unit, functional, and upgrade execution by architecture.
  • Publish combined changed-line coverage in the validation summary. Count each changed source line once, with a hit from either product or unit tests.
  • Label per-line evidence as product plus unit, product only, unit only, uncovered, or unmeasured. Retain the separate product and unit measurements.
  • Link the summary to downloadable per-line detail and the separate reports. Source links identify the tested revision.
  • Keep absent coverage entries explicit. Report N/A when no changed lines have coverage entries, rather than treating missing evidence as 100% coverage.
  • Add unit tests for worker completeness, source identity, source-path mapping, and invalid coverage evidence.
  • Add unit tests for the combined source-line union and evidence labels. The tests verify duplicate attribution and unmeasured changed lines.

Coverage Scope

The reports measure managed source. Native C++ remains unmeasured.
Unit-only execution does not prove execution in the deployed product.
Line coverage does not prove assertion quality or complete branch coverage.

This change adds no coverage threshold.
The release pipeline does not enable instrumentation.
Uninstrumented installer drops retain the existing test path.

Build an isolated instrumented installer for x64 shard 0 and collect coverage before Windows services start. Keep ordinary installers and test selections unchanged for the other workers.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
@tyrielv

Copy link
Copy Markdown
Contributor Author

Do not complete - I marked this ready for review so we could verify #2153 is a problem.

@tyrielv
Tyrie Vella (tyrielv) marked this pull request as draft November 4, 2026 15:36
Grant LocalSystem access through the Visual Studio collector. Verify service startup coverage before the selected functional shard runs.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
Instrument non-release payloads in the existing builds. Collect unit, functional, and upgrade evidence without a second test suite, and preserve source identity and separate unit-copy attribution.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
@tyrielv Tyrie Vella (tyrielv) changed the title Probe NativeAOT coverage on one functional shard Collect managed coverage across CI test workers Nov 5, 2026
Tyrie Vella (tyrielv) and others added 3 commits November 5, 2026 12:40
Strip argument quotes before the batch script compares or assigns configuration and architecture. Preserve the existing defaults and test command.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
Resolve local relative paths without weakening source-path checks. Accept empty optional scenario fields and valid NUnit skipped roots. Compare PR coverage against the tested merge base.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
Count each changed source line once and retain product/unit evidence labels. Publish source-level detail and preserve unknown coverage and separate measurements.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

2 participants