Skip to content

fix(website): production-smoke spec must not use import.meta.url - #973

Merged
blove merged 1 commit into
mainfrom
blove/fix-production-smoke-esm
Sep 3, 2026
Merged

fix(website): production-smoke spec must not use import.meta.url#973
blove merged 1 commit into
mainfrom
blove/fix-production-smoke-esm

Conversation

@blove

@blove blove commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The production-smoke spec added in #963 has 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.

The Production smoke job 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 outside PRODUCTION_SMOKE mode, so no PR ever loaded it; the failure only appeared post-merge on main, 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

  • Before: the exact CI command exits 1 with No tests found.
  • After: the spec collects 104 tests.
  • Ran the suite against production: 98 passed, 5 failed, 1 skipped.

The 5 failures are real production findings, not caused by this change

Reported separately so this fix isn't blocked on them:

  1. Legacy Cockpit redirect service (4 tests) — cockpit.threadplane.ai answers 200 where 308 is expected, for the root, Docs-backed and workspace-only cases, and does not 404 unknown paths. The Cockpit surface retirement is not live in production.
  2. Unified runtime embedding policy — the assembled frame-ancestors policy does not validate (validateRuntimeParentOrigins returns null).

Both look like the cockpit surface not having promoted rather than defects in the merged code, but they need confirming.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 3, 2026 12:27am UTC

Request Review

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@blove
blove merged commit 26ec7e9 into main Sep 3, 2026
76 checks passed
@blove
blove deleted the blove/fix-production-smoke-esm branch September 3, 2026 00:51
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.

1 participant