Skip to content

test(build-guards): make dist-gated skip explicit via WM_EXPECT_BUILT_OUTPUT - #6284

Merged
koala73 merged 2 commits into
mainfrom
fix/eager-chunk-guards
Aug 7, 2026
Merged

test(build-guards): make dist-gated skip explicit via WM_EXPECT_BUILT_OUTPUT#6284
koala73 merged 2 commits into
mainfrom
fix/eager-chunk-guards

Conversation

@koala73

@koala73 koala73 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Fixes #6139

Two test files guard built output and disagreed on what to do when
dist/dashboard.html is missing:

File Before After
tests/dashboard-eager-chunks.test.mjs Silently skipped via { skip: !existsSync(dashboardHtml) } — fail-open Skips when no marker; fails with clear error when WM_EXPECT_BUILT_OUTPUT=1
tests/dashboard-critical-css.test.mjs Hard-failed always via builtSrc() assert Same env-marker respect: skips locally, fails in CI

The fix: introduce WM_EXPECT_BUILT_OUTPUT env marker. Both files now:

  • Skip when unset and artifact is missing (local dev, no build)
  • Fail with a descriptive error when set and artifact is missing (CI)
  • Run normally when artifact exists

CI exports WM_EXPECT_BUILT_OUTPUT=1 before npm run test:data in .github/workflows/test.yml.

Verification:

  • Without marker + no dist: 11 tests pass, 8 dist-gated suites correctly skip
  • With WM_EXPECT_BUILT_OUTPUT=1 + no dist: suites fail with dist/dashboard.html is missing but WM_EXPECT_BUILT_OUTPUT=1

…_OUTPUT

Two test files guard built output and disagreed on what to do when
dist/dashboard.html is missing. dashboard-eager-chunks.test.mjs silently
skipped every guard via { skip: !existsSync(dashboardHtml) } — a fail-open
that could let a regression ship if the build step stops producing the
artifact. dashboard-critical-css.test.mjs hard-failed with a clear message.

Fix: introduce WM_EXPECT_BUILT_OUTPUT env marker. Both files now:
- Skip when unset and artifact missing (local dev, no build)
- Fail with a descriptive error when set and artifact missing (CI)
- Run normally when artifact exists

CI exports WM_EXPECT_BUILT_OUTPUT=1 before npm run test:data (#6139).
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
worldmonitor Ignored Ignored Preview Aug 7, 2026 9:08am

Request Review

@koala73
koala73 merged commit c5df27c into main Aug 7, 2026
30 checks passed
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.

test(build-guards): dist-gated eager-chunk guards skip silently when the build stops emitting dashboard.html

1 participant