dx: headless API test runner, typecheck ratchet, unit aggregate + Web CI (TODO 15, consolidates #119/#123/#126) - #121
Merged
Merged
Conversation
The 58-endpoint /tests suite could only run in the browser. This adds: - remix/scripts/run-api-tests.mts — a tsx CLI that imports the SAME apiTests.ts definitions and runApiTest executor the page uses (one source of truth), with a cookie-jar fetch so authed sequences work, --group/--skip-mutating/--bail/--json flags, and a non-zero exit on failure. - apiTestRunner.ts made isomorphic: plain setTimeout/clearTimeout, an optional context.fetchImpl, and origin-resolved URLs. The /tests page behavior is unchanged (verified live: Run Health → 4/4). - 'test' and 'typecheck' package scripts (tsx devDependency). - .github/workflows/api-tests.yml: Mongo 7 service + the real dev stack, runs the full suite; plus a non-blocking typecheck job as the first step of the strictness ratchet. - Seven test expectations made state-independent: the suite leaves a non-admin session cookie after the auth group, so admin-gated routes legitimately return 403 (not only 401), unified PUT can 404, and the two tight per-IP auth windows can 429 on repeat runs — in the browser exactly as in CI. Full suite headless: 241/241 passed; --skip-mutating: 226/226. Remaining item-15 scope (follow-ups): progressive tsc strictness, unifying the two ThingtimeTypes interfaces, Commander V1→V2 cleanup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
continue-on-error kept the workflow green but still painted a red X on the PR. The baseline job now always exits 0 and publishes the tsc error count + first errors to the job summary; make it exit non-zero once the baseline is clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…te, single Web CI Absorbs the best of the parallel PRs #119, #123, and #126 into this branch (#121), so one PR carries TODO item 15: - typecheck ratchet (from #126): scripts/typecheck-ratchet.mjs + typecheck-baseline.json (134 errors today) — CI fails only when the tsc error count grows, and --update-baseline locks in reductions. - test:unit aggregate (from #119/#123), with the node --test suites loading through tsx instead of a hand-rolled resolve hook — fixes the previously broken ~/-alias suites and adds the scriptless mongodb/*.test.ts suite (109 unit tests, all passing). - runner --list flag (parity with the other runners). - TODO.md item-15 status note (from #123, updated). - one workflow: api-tests.yml + the others' ci.yml variants become web-ci.yml — build + ratchet + unit tests, plus the headless 243-test API suite against a real Vite + Nitro + Mongo stack; path-filtered to remix/**, read-only token, node 24. Verified locally: ratchet at baseline, 109/109 unit tests, 243/243 API tests against a live dev stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 29, 2026
…ates the gate CI's pull_request checkout is branch-merged-into-main; origin/main added 9 tsc errors (appData.ts et al) after the baseline was recorded. Merged main in and recounted so local and CI agree. Verified post-merge: 109/109 unit, 250/250 API against a live stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Conflicted files (as recorded by the merge step):
|
Conflicted paths: remix/package.json Resolved by the resolve-pr-conflicts workflow: https://github.com/lopugit/thingtime/actions/runs/30546078186 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
🤝 Merged Conflicted files:
Please review the merge commit before relying on it. |
Conflicted paths: remix/package.json Resolved by the resolve-pr-conflicts workflow: https://github.com/lopugit/thingtime/actions/runs/31081881115 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
🤝 Merged Conflicted files:
Please review the merge commit before relying on it. |
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.
TODO item 15 — DX ratchet, consolidated
Four parallel sessions independently built item 15 (#119, #121, #123, #126). Per Lopu's request this PR now carries the best of all four in one place; the other three are closed with credit.
What's in it
Headless API test runner (
remix/scripts/run-api-tests.mts,npm run test:api)apiTests.tsdefinitions +runApiTestexecutor the interactive/testspage uses — one source of truth, the page and CI can never drift (test == live cohesion).apiTestRunner.tsmade isomorphic (optionalfetchImpl, origin-resolved URLs) instead of monkey-patchingglobalThis.fetch.--base,--group,--skip-mutating,--bail,--json,--list,--help./testspage too).Typecheck ratchet (from #126 —
npm run typecheck:ratchet)scripts/typecheck-baseline.jsonrecords today's count (134 tsc errors). CI fails only when the count grows; shrinking it nags you to lock it in via--update-baseline. Rawnpm run typecheckstill shows everything.Unit-test aggregate (from #119/#123 —
npm run test:unit)node --testsuites now load through tsx (already a devDep for the runner) instead of the three hand-rolled~/-alias resolve hooks the parallel PRs each invented — this un-breakstest:editorjs/test:schemas(~/imports) and adds the previously scriptlessmongodb/*.test.tssuite. 109 unit tests, all passing.npm test=test:unit+test:api.One CI workflow (
.github/workflows/web-ci.yml, replacing this PR's earlierapi-tests.ymland the others'ci.yml/web-ci.ymlvariants)buildjob: Vite client build + typecheck ratchet + unit tests.api-testsjob: real dev stack (Vite + Nitro) +mongo:7service, then the full 243-test suite headlessly — no mocks, per FUNDAMENTALS.md.remix/**,permissions: contents: read, concurrency-cancelled, node 24.TODO.md item 15 marked mostly-done with what remains (progressive strictness burn-down; Commander V1→V2 blocked on #130;
ThingtimeTypesalready unified in #153).Verified
typecheck:ratchet→ 134 errors, at baseline ✅test:unit→ 109/109 ✅Credits
s8):test:unitaggregate, path-filtered CI shape, populate-expectation fixs3): unit-test aggregate + TODO.md status note, editorjs-suite fixs1): the typecheck ratchet (baseline + fail-on-regression) — adopted nearly wholesale🤖 Generated with Claude Code