mirror of
https://github.com/willchen96/mike.git
synced 2026-07-26 23:51:08 +02:00
Three fixes that take the suite from ~everything-failing to green (verified end
to end against a local stack):
1. schema.sql lags the migrations (missing e.g. workflow_open_source_submissions,
which GET /workflows/:id queries → 500). Apply every dated migration on top of
schema.sql (idempotent; 0 errors on a fresh DB), grant service_role AFTER so
new tables are covered, then reload PostgREST. Fixes the workflow specs.
2. Serve a production build (next build + next start) instead of next dev. The dev
server's on-demand compilation (slow first hit → waitForResponse timeouts) and
hydration-error overlay (injects nextjs__container_errors DOM that pollutes text
locators, e.g. getByText('All') matching 'Call Stack') made the suite flaky.
Fixes tabular-reviews list render + the timing flakes.
3. LLM-dependent specs (chat rename/delete/submit, critical-path) require a model
key to send a message. Guard them with test.skip(!hasLlmKey) (e2e/llm.ts) and
expose ANTHROPIC_API_KEY to the Playwright process, so a keyless run is green on
the ~23 other specs and the LLM specs run + enforce only when the secret is set.
Local result (no key, with MinIO+LibreOffice as on ubuntu-latest): 23 passed,
4 skipped, 0 failed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
926 B
TypeScript
18 lines
926 B
TypeScript
/**
|
|
* Helpers for specs that require a live LLM turn.
|
|
*
|
|
* A few specs create/populate a chat by sending a message and awaiting a
|
|
* streamed answer. That only works when a model key is configured — in CI the
|
|
* `ANTHROPIC_API_KEY` secret, which `.github/workflows/e2e.yml` exposes to the
|
|
* Playwright process. When it is absent (a plain local run, or a fork PR with no
|
|
* secret access) the app blocks message send behind the ApiKeyMissingModal, so
|
|
* these specs would hang to their timeout.
|
|
*
|
|
* Guarding them with `test.skip(!hasLlmKey, LLM_SKIP_REASON)` keeps a keyless
|
|
* run green and fast on the ~20 specs that don't need a model, while still
|
|
* running — and enforcing — the LLM specs whenever the key is present.
|
|
*/
|
|
export const hasLlmKey = Boolean(process.env.ANTHROPIC_API_KEY);
|
|
|
|
export const LLM_SKIP_REASON =
|
|
"requires a model key — set the ANTHROPIC_API_KEY secret to run LLM-dependent specs";
|