Commit a5f1a9b
fix: restore E2E coverage source mapping (#14950)
## Summary
E2E coverage has been reported as either missing or 100% since
`build.sourcemap: 'hidden'` landed; this restores the source mapping and
adds guards so a degenerate tracefile fails loudly instead of being
announced as a milestone.
## Changes
- **What**:
- The E2E build sets `COLLECT_COVERAGE=true`, which re-injects the `//#
sourceMappingURL=` comment. Everything that ships to users keeps
`'hidden'`, so the `.js.map` 404 noise FE-1405 removed stays gone.
`GENERATE_SOURCEMAP` can't carry this — `Comfy-Org/cloud` already sets
it true for the staging and prod builds.
- `CI: E2E Coverage` asserts the merged tracefile still has
source-mapped files before stripping bundle paths, with an error that
names the cause.
- `coverage-slack-notify.ts` counts only `src/`/`packages/` files and
treats an implausibly small file set as no data.
## Review Focus
Root cause: monocart-coverage-reports resolves source maps *only* from
the `//# sourceMappingURL=` comment in the served bundle
(`lib/converter/collect-source-maps.js`).
#14209 switched
`build.sourcemap` to `'hidden'`, which emits the `.map` files but strips
that comment, so every V8 coverage entry stayed at its served path
(`localhost-8188/assets/*.js`).
The merge job strips those paths, which left two failure modes:
- Nothing survives → `lcov: ERROR: no valid records found` → job fails →
no `e2e-coverage` artifact → the Slack report silently drops its E2E
line (what you see after
#14809).
- One third-party script survives (`js.stripe.com/dahlia/stripe.js`,
fully covered) → E2E reported as 100% (`e2e-coverage` artifacts drop
from ~350 KB to ~28 KB). That is the source of the "GOAL REACHED: E2E
test coverage hit 100%" messages.
Replaying the current script against the real 28 KB artifact reproduces
the Slack message exactly (`E2E: 68.5% → 100.0% (+31.5%)`); with this
change the same input produces no post.
The only source-mapped E2E artifacts after 2026-07-30 came from PR
branches not yet rebased past #14209 — hence the decay from ~170/day to
zero rather than a clean cutover.
Note the stored `e2e-coverage-baseline` currently holds the bogus 100%,
so the first run after this merges will look like a large regression and
post nothing; the baseline self-heals on that same run.
---------
Co-authored-by: Connor Byrne <c.byrne@comfy.org>1 parent 78ee22a commit a5f1a9b
5 files changed
Lines changed: 92 additions & 6 deletions
File tree
- .github/workflows
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
260 | 262 | | |
261 | 263 | | |
262 | 264 | | |
263 | | - | |
| 265 | + | |
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | | - | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
49 | | - | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
233 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
546 | 547 | | |
547 | 548 | | |
548 | 549 | | |
549 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
550 | 553 | | |
551 | 554 | | |
552 | 555 | | |
| |||
0 commit comments