Skip to content

Exclude test-app build tooling from coverage scope - #673

Merged
fpigeonjr merged 1 commit into
masterfrom
gh-627-exclude-test-app-build-tooling-from-coverage
Sep 1, 2026
Merged

Exclude test-app build tooling from coverage scope#673
fpigeonjr merged 1 commit into
masterfrom
gh-627-exclude-test-app-build-tooling-from-coverage

Conversation

@fpigeonjr

Copy link
Copy Markdown
Contributor

Description

master has been red since #670 merged. The failure is the coverage-floor gate, not a test failure — all 151 spec files / 1377 tests pass:

  ✖ statements  88.57% (floor 88.73%)
  ✖ branches    78.57% (floor 78.65%)
  ✖ functions   85.74% (floor 85.90%)
  ✖ lines       88.55% (floor 88.72%)

Cause: a merge-order collision between #668 and #670. Both PRs were green on their own branches; master got the union.

Confirmed by diffing the two runs' test-app-coverage artifacts. The only files present in the failing report but absent from #670's green one are the four #668 additions; the two gallery components are 100% covered, the two tooling files are 0%.

#670's PR run (green) master (red)
statements 6655/7500 = 88.73% 6659/7518 = 88.57%

The change

One hunk in test-app/vitest.config.mts — two entries added to coverage.exclude:

"dedupe-packages.ts",
"esbuild/**",

This matches the rationale already documented in that config for src/main.ts, src/app/app.module.ts, src/environments/** and playwright.config.ts: keep harness/build scaffolding that has nothing to do with the library under test out of the denominator.

coverage-floor.json is deliberately untouched. Verified against the failing run's coverage artifact that dropping exactly these two files restores statements 88.73 / branches 78.65 / functions 85.90 / lines 88.72 — at or above every floor. Per the ratchet policy in AGENTS.md and scripts/check-coverage.mjs, lowering the floor to go green isn't an option anyway.

Follow-up worth tracking (not fixed here)

Coverage now sits exactly on the floor, with zero margin — the next non-library file added anywhere under test-app/ that isn't excluded will re-break master in precisely this way. Suggest tracking a real buffer (or a stricter coverage.include scoped to the library source) on #669.

Motivation and Context

Regression fix for the floor locked in #637 / #670, interacting with the harness added in #668.

Refs #637

Type of Change (Select One and Apply Label)

  • Bug fix (non-breaking change which fixes an issue) → Apply bugfix label
  • New feature (non-breaking change which adds functionality) → Apply enhancement label
  • Breaking change (fix or feature that would cause existing functionality to change) → Apply breaking label
  • Documentation / configuration update → Apply maintenance label

How to Test

  1. npm ci && npm ci --prefix test-app
  2. npm --prefix test-app test — full Vitest suite with coverage; writes test-app/coverage/coverage-summary.json.
  3. npm run coverage:check — the gate that is currently failing on master.
  4. To see the bug this fixes, revert just the config hunk and re-run: git stash push test-app/vitest.config.mts && npm --prefix test-app test && npm run coverage:check (expect all four metrics to fail by ~0.16pp), then git stash pop.

Expected result: step 2 reports 151 files / 1377 tests passed with statements 88.73% / branches 78.65% / functions 85.90% / lines 88.72%, and step 3 prints ✓ Coverage gate passed. with all four metrics at or above their floors. Step 4 reproduces the four lines from the failing master run.

Screenshots (if appropriate)

N/A — test-config-only change, no source, UI, or behavioral changes.

Checklist

  • Branch name follows convention (e.g. gh-<number>-<slug>)
  • PR title starts with a verb in the imperative mood
  • I have self-reviewed my own code
  • format:check passes (npm run format:check)
  • lint passes (npm run lint) — 0 errors; root baseline gate passes at 1575 warnings (baseline 1619), test-app 0 errors / 4 pre-existing warnings
  • build passes (cd test-app && npm run build)
  • Tests pass and coverage is reported (cd test-app && npm test)
  • If this change requires a documentation update, I have updated it accordingly
  • If there are dependent changes, they have been merged and published in downstream modules

master has been red since #670 merged. The failure is the coverage-floor
gate, not a test failure — all 1377 specs pass:

  statements  88.57% (floor 88.73%)
  branches    78.57% (floor 78.65%)
  functions   85.74% (floor 85.90%)
  lines       88.55% (floor 88.72%)

Cause is a merge-order collision between #668 and #670. #668 (merged
11:21) added the Playwright component-render harness, including two
test-app build-tooling files — dedupe-packages.ts and
esbuild/dedupe-angular-plugin.ts. Both run inside the bundler, so no
spec can ever execute them, but coverage.all walks the project and they
weren't in coverage.exclude, so they landed in the report at 0%
(14 statements, 4 branches, 4 functions, 14 lines of pure denominator).
#670 (merged 11:24) then locked the floor at coverage measured on a
branch cut from 081088f — before #668 — so its denominator never saw
those files. Each PR was green on its own; master got the union.

Extend coverage.exclude to cover both files, matching the rationale
already documented for src/main.ts, app.module.ts, environments/** and
playwright.config.ts: keep harness/build scaffolding that has nothing to
do with the library under test out of the denominator. Verified against
the failing run's coverage artifact that dropping exactly these two
files restores statements 88.73 / branches 78.65 / functions 85.90 /
lines 88.72 — at or above every floor, so coverage-floor.json is
untouched (and per AGENTS.md, lowering the floor to go green isn't an
option).

Refs #637
@fpigeonjr fpigeonjr added bugfix maintenance Repo maintenance / tooling labels Sep 1, 2026
@fpigeonjr fpigeonjr self-assigned this Sep 1, 2026
@fpigeonjr
fpigeonjr requested a lite review from Copilot September 1, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Vitest coverage configuration in test-app to exclude Playwright harness build-tooling files from the coverage denominator, restoring the intended “library code only” coverage scope and unblocking the coverage-floor.json gate on master.

Changes:

  • Excludes test-app/dedupe-packages.ts from coverage reporting.
  • Excludes everything under test-app/esbuild/** from coverage reporting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@fpigeonjr
fpigeonjr marked this pull request as ready for review September 1, 2026 17:44
@fpigeonjr
fpigeonjr requested a review from a team as a code owner September 1, 2026 17:44
@fpigeonjr
fpigeonjr merged commit 12b580b into master Sep 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix maintenance Repo maintenance / tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants