Skip to content

test: wire the three orphaned suites into CI - #5331

Merged
viktormarinho merged 3 commits into
mainfrom
viktormarinho/wire-orphaned-tests
Jul 28, 2026
Merged

test: wire the three orphaned suites into CI#5331
viktormarinho merged 3 commits into
mainfrom
viktormarinho/wire-orphaned-tests

Conversation

@viktormarinho

@viktormarinho viktormarinho commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Three suites ran in no workflow at all — coverage that looked like coverage but couldn't catch anything:

1. Two .e2e.-named files that are actually unit tests — the filename rule excluded them from the unit tier and nothing else picked them up:

  • packages/typegen/src/cli.e2e.test.tscli.test.ts: self-contained (in-process MCP server + the real CLI), 8 tests in 1.1s.
  • apps/api/.../user-ask.e2e.test.tsuser-ask.test.ts: mocks all params, asserts tool registration/schemas in-process; 30 tests. Header comment updated to stop claiming E2E.
  • Unit tier goes 680 → 686 files, all green under --parallel.

2. apps/web/ct Playwright component tests (174 tests) — new component-tests job in test.yml: chromium with browser cache, timeout-minutes: 15, gated on a new web output of the changes gate (apps/web/* or packages/ui/*), so backend-only PRs skip it. Not yet a required check — promote via branch protection once it proves stable.

3. The rot the wiring surfaced — 14 drifted ct tests, all fixed against current component behavior:

  • Sortable item rows became role=button wrappers whose accessible name concatenates the inline action buttons → row locators rewritten (filter({ hasText }) helper, exact: true on the actions menu).
  • rich-text/rich-text-inline render a TipTap editor now (contenteditable ProseMirror, HTML model values), not a <textarea> → tests rewritten for the editor.
  • NumberField deliberately renders type=text + inputMode=decimal|numeric (preserves mid-typing states like 0.) → assertions updated.
  • Every value still round-trips — none of the 14 were real regressions, so zero test.fixme.

Strays fixed in passing: storage-integration's find now scans apps/api and packages (its own comment already promised "every `*.integration.test.ts` file is picked up here" — false for packages until now); Playwright ct's vite build cache (apps/web/ct/playwright/.cache/) is gitignored — knip and oxlint were scanning bundle output.

Testing notes

  • ct suite: 174/174 across 3 consecutive full runs (~12s each).
  • Unit suite: 6216 pass / 0 fail, 686 files.
  • bun run check ✓ · lint ✓ · knip ✓ · fmt:check
  • This PR touches apps/web/*, so the new component-tests job runs on this PR itself — the wiring validates itself.

🤖 Generated with Claude Code


Summary by cubic

Wires three previously unrun test suites into CI to make coverage real and catch regressions. Adds a Playwright component-tests job, fixes drifted CT assertions, broadens test discovery, prevents a typegen test hang on CI, and speeds up Playwright installs with cache restore-keys.

  • New Features

    • Added component-tests job in .github/workflows/test.yml for apps/web/ct (Chromium cached, 15‑min timeout), gated by a new web filter for apps/web/* and packages/ui/*; not required yet.
  • Bug Fixes

    • Closed the MCP server in packages/typegen/src/cli.test.ts teardown to avoid a lingering session stream that hung CI under bun test --parallel.
    • Renamed two misnamed unit tests from .e2e.test.ts to *.test.ts so the unit suite runs them (packages/typegen/src/cli.test.ts, apps/api/.../user-ask.test.ts).
    • Updated CT assertions to match current UI: sortable rows via role=button + hasText; rich-text/rich-text-inline now TipTap with HTML values; number/integer use type=text with inputmode.
    • Broadened discovery and cleanup: storage-integration.yml finds *.integration.test.ts in apps/api and packages; ignored Playwright CT Vite cache at apps/web/ct/playwright/.cache/.
    • Playwright CI: added restore-keys to browser caches in .github/workflows/e2e.yml and the CT job to avoid cold installs on key rotations; step labels now specify Chromium.

Written for commit b1fc316. Summary will update on new commits.

Review in cubic

viktormarinho and others added 3 commits July 28, 2026 11:44
Three test suites ran in no workflow at all — coverage that looked like
coverage but couldn't catch anything:

- packages/typegen cli.e2e.test.ts and apps/api user-ask.e2e.test.ts
  were unit tests wearing .e2e names (the filename rule excluded them
  from the unit tier and nothing else picked them up). The typegen one
  is self-contained (in-process MCP server + real CLI, 1.1s); user-ask
  mocks everything and asserts registration/schemas. Renamed to .test.ts
  so scripts/test-unit.ts discovers them — suite goes 680→686 files.

- apps/web/ct (Playwright component tests, 174 tests) get a dedicated
  component-tests job in test.yml: chromium cached, 15min timeout,
  gated on a new 'web' output of the changes gate (apps/web/* or
  packages/ui/* — backend PRs don't pay for browser tests). Not yet a
  required check (branch protection unchanged).

Rot found and fixed while wiring: 14 ct tests had drifted from the
components (sortable rows became role=button with concatenated
accessible names; rich-text/rich-text-inline render a TipTap editor
now, not a <textarea>, with HTML values; NumberField deliberately
renders type=text + inputMode to preserve mid-typing states). All
assertions updated against current component behavior — every value
still round-trips, so none were real regressions. 174/174 pass across
repeated runs.

Also: storage-integration's find now scans apps/api AND packages, which
its own comment already promised ('every *.integration.test.ts file is
picked up here'); playwright ct's vite build cache is gitignored (knip
and oxlint were scanning the bundle output).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tream hung CI at exit

All 8 tests passed on CI but the job then sat until the 10-minute
timeout: afterEach only stopped the Bun.serve wrapper, leaving the MCP
SDK server's session stream alive, which kept that worker's event loop
spinning after the parallel run finished (the coordinator waits on
worker exit; per-file output buffering means nothing points at the
culprit). Close the MCP server first — it closes its transport and
session streams — then stop the HTTP server.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The TS7 merge bumped packages/e2e/package.json, rotating the e2e
playwright cache key — with no restore-keys that means a full cold
chromium download + apt install (~6min observed) on every key rotation.
The fallback restores the previous browsers so playwright install only
fetches what's missing. Same for the new component-tests cache.

Also rename 'Install Playwright browsers' → 'Install Playwright
chromium': the step installs exactly one browser; the plural was a lie
inherited from copy-paste.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@viktormarinho
viktormarinho merged commit 058fd09 into main Jul 28, 2026
15 checks passed
@viktormarinho
viktormarinho deleted the viktormarinho/wire-orphaned-tests branch July 28, 2026 16:12
decocms Bot pushed a commit that referenced this pull request Jul 28, 2026
PR: #5331 test: wire the three orphaned suites into CI
Bump type: patch

- decocms (apps/api/package.json): 4.139.13 -> 4.139.14
- @decocms/typegen (packages/typegen/package.json): 0.4.0 -> 0.4.1

Deploy-Scope: both
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