Skip to content

Bug: cobertura-package-rates-not-recomputed #529

Description

@drmoisan
  • Work Mode: minor-audit

Summary

Package-level line-rate and branch-rate are never recomputed after Cobertura package filtering and class merging, so every surviving <package> carries a stale rate computed over a different, larger class set.

Environment

  • OS/version: Windows 11 Pro 10.0.26200
  • Python version: n/a (PowerShell)
  • Command/flags used: ConvertTo-KoverageCoberturaXml -XmlContent <cobertura> -RepoRoot <root> -PathSeparator '\'
  • Data source or fixture: docs/features/active/2026-08-06-quickfiler-high-confidence-queue-init-stall-424/evidence/qa-gates/coverage-final.cobertura.xml

Steps to Reproduce

  1. Dot-source scripts/vscode/Invoke-MSTestWithCoverage.Helpers.ps1.
  2. Run ConvertTo-KoverageCoberturaXml over a raw dotnet-coverage Cobertura document that contains .Test packages and multiple same-filename classes.
  3. Inspect the line-rate and branch-rate attributes of any surviving <package> element in the output and compare them against a rate recomputed from that package's post-filter, post-merge class set.

Expected Behavior

After package filtering removes .Test packages and class merging unions same-filename classes, each surviving <package> should carry line-rate and branch-rate recomputed over its own post-processing class set.

Actual Behavior

ConvertTo-KoverageCoberturaXml writes only the six root <coverage> attributes and the line-rate / branch-rate / complexity attributes of merged class elements. It never recomputes <package line-rate=...> or <package branch-rate=...>, so each package retains the value the generator emitted for a different, larger class set.

Logs / Screenshots

  • Attached minimal logs or snippet
  • Snippet: the stale values are consumed downstream by scripts/temp-extract-coverage.ps1:47, which reads $pkg.'line-rate' for per-assembly reporting.

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Per-assembly reported coverage is wrong wherever filtering or merging changed a package's class set. Repository-wide root attributes are unaffected (those were corrected by #441).

Source

From: docs/features/potential/2026-08-10-cobertura-package-rates-not-recomputed.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions