Exclude test-app build tooling from coverage scope - #673
Merged
fpigeonjr merged 1 commit intoSep 1, 2026
Conversation
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
There was a problem hiding this comment.
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.tsfrom 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
marked this pull request as ready for review
September 1, 2026 17:44
mgetzflex
approved these changes
Sep 1, 2026
divyabairavarasu
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
masterhas been red since #670 merged. The failure is the coverage-floor gate, not a test failure — all 151 spec files / 1377 tests pass:Cause: a merge-order collision between #668 and #670. Both PRs were green on their own branches;
mastergot the union.test-approot:dedupe-packages.tsandesbuild/dedupe-angular-plugin.ts. Both run inside the bundler, so no spec can ever execute them — but Vitest'scoverage.allwalks the project and neither was incoverage.exclude, so they landed in the report at 0%: 14 statements, 4 branches, 4 functions, 14 lines of pure denominator.081088fe— i.e. before Fix inactive tab content rendering on top of active tab in sam-tabs-next #668 — so its denominator never saw those files.Confirmed by diffing the two runs'
test-app-coverageartifacts. 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%.master(red)The change
One hunk in
test-app/vitest.config.mts— two entries added tocoverage.exclude:This matches the rationale already documented in that config for
src/main.ts,src/app/app.module.ts,src/environments/**andplaywright.config.ts: keep harness/build scaffolding that has nothing to do with the library under test out of the denominator.coverage-floor.jsonis 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 inAGENTS.mdandscripts/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-breakmasterin precisely this way. Suggest tracking a real buffer (or a strictercoverage.includescoped 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)
bugfixlabelenhancementlabelbreakinglabelmaintenancelabelHow to Test
npm ci && npm ci --prefix test-appnpm --prefix test-app test— full Vitest suite with coverage; writestest-app/coverage/coverage-summary.json.npm run coverage:check— the gate that is currently failing onmaster.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), thengit 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 failingmasterrun.Screenshots (if appropriate)
N/A — test-config-only change, no source, UI, or behavioral changes.
Checklist
gh-<number>-<slug>)format:checkpasses (npm run format:check)lintpasses (npm run lint) — 0 errors; root baseline gate passes at 1575 warnings (baseline 1619),test-app0 errors / 4 pre-existing warningsbuildpasses (cd test-app && npm run build)cd test-app && npm test)