fix(website): production-smoke spec must not use import.meta.url - #973
Merged
Conversation
The spec added in #963 never loaded. Playwright transpiles specs to CJS (`var _test = require("@playwright/test")`), so `import.meta.url` compiles to a `require` the loaded module cannot resolve: ReferenceError: require is not defined in ES module scope at platform-production-smoke.spec.ts:1 Error: No tests found. Production smoke has therefore been reporting "no tests" rather than running, so the job has verified nothing since it landed. Resolve the repo-root policy file from __dirname, which is what the emitted CJS module actually has. The spec is testIgnore'd outside PRODUCTION_SMOKE mode, so nothing on a PR ever loaded it — the failure only surfaced post-merge on main. Add a Website e2e step that collects it with --list, which loads every spec without touching production, so this cannot recur. Verified: the spec now collects 104 tests, and running it against production gives 98 passed / 5 failed / 1 skipped. The 5 failures are real production findings (legacy Cockpit redirects still answer 200 instead of 308, and the assembled frame-ancestors policy does not validate) and are reported separately — they are not caused by this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
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.
Summary
The production-smoke spec added in #963 has never loaded. Playwright transpiles specs to CJS (
var _test = require("@playwright/test")), soimport.meta.urlcompiles to arequirethe loaded module cannot resolve:The
Production smokejob has been reporting "No tests found" rather than running, so it has verified nothing since it landed. Resolving the repo-root policy file from__dirname— what the emitted CJS module actually has — fixes it.Why nothing caught this
The spec is
testIgnore'd outsidePRODUCTION_SMOKEmode, so no PR ever loaded it; the failure only appeared post-merge onmain, where it's too late to gate anything. This PR adds a Website e2e step that collects the spec with--list, which loads every spec without touching production.Verification
No tests found.The 5 failures are real production findings, not caused by this change
Reported separately so this fix isn't blocked on them:
cockpit.threadplane.aianswers200where308is expected, for the root, Docs-backed and workspace-only cases, and does not404unknown paths. The Cockpit surface retirement is not live in production.frame-ancestorspolicy does not validate (validateRuntimeParentOriginsreturnsnull).Both look like the cockpit surface not having promoted rather than defects in the merged code, but they need confirming.
🤖 Generated with Claude Code