Skip to content

test(GAT-9592): port the Vitest integration and unit suites - #138

Merged
calmacx merged 3 commits into
feat/GAT-9591-api-routesfrom
feat/GAT-9592-tests
Sep 23, 2026
Merged

calmacx merged 3 commits into
feat/GAT-9591-api-routesfrom
feat/GAT-9592-tests

Conversation

@calmacx

@calmacx calmacx commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

What

Ports the Vitest integration and unit suites from poc/GAT-XXXX — translate, validate, find, get, list, openapi and the contract-regression cases — with the shared helpers, the global setup that waits on a running server, both vitest configs, and the relocated Express fixture inputs under tests/data/. Also fixes four real defects in app/lib/schema.server.ts, app/routes/api/find.ts and app/routes/api/translate.ts.

Why

The rewrite had no test suite of its own until this point; PRs below it were gated only on typecheck, lint and build. The four fixes are genuine bugs, not test scaffolding — one of them stopped a broken JSONata map returning a server-side stack trace, absolute filesystem paths included, to any caller of /translate.

Testing

npm test — 8 files, 54 tests — and npm run test:unit — 2 tests — both green against a production build (npm run build && npm start), not dev mode. npm run typecheck, npm run lint and npm run build all exit 0.

Notes

  • The production replay harness is not in this PR. It and its ~900KB captured corpus live outside the repo in an untracked regression-suite/ directory, ignored via .gitignore. The behavioural differences it documented are written up there as prose instead of carried as fixtures through every clone and review.
  • The four fixes were originally found by that replay. They stand on their own merits and are unaffected by its removal.
  • tests/regressions.test.ts (plural) is a normal contract-regression suite and is unrelated to the removed replay harness — easy to confuse by name.

🤖 Generated with Claude Code

@gh-actions-pipelines-app

Copy link
Copy Markdown

🎉 Great job! Your PR title follows the correct format. 🚀

@calmacx
calmacx added this pull request to stack #139 September 22, 2026 09:17
@calmacx
calmacx force-pushed the feat/GAT-9592-tests branch from c3df7fd to 563ebda Compare September 22, 2026 09:24
…fects

Found by replaying the production fixtures under strict equality. Each is a
difference from the Express service that nobody chose.

1. A failing JSONata map returned 400 with the raw jsonata error as `details`
   — including a `stack` carrying absolute server paths. Express returned 500
   `Failed to execute translation between X and Y` with an empty `details`.
   12 of the 104 fixtures trigger this, so it is a live information-disclosure
   path rather than a theoretical one. The jsonata error now goes to the server
   log and the response matches Express.

2. Output-validation failures gained a top-level `data` key holding the
   rejected translation. Express built that object but its catch block returned
   only {message, details}, so production never emitted it.

3. /find with a non-JSON content type dropped `value: {}` from its error entry.
   express-validator includes the unparsed body there.

4. `Subsection X not found` lost Express's ` in provided metadata.` suffix.

Nothing here changes a success path. The two message and status changes are
restorations, not new behaviour.
Brings the integration suites across from poc/GAT-XXXX — translate,
validate, find, get, list, openapi and the contract-regression cases —
along with the shared helpers, the global setup that waits on a running
server, both vitest configs and the relocated Express fixture inputs
under tests/data/.

The production replay harness that originally accompanied these suites
is not here. It and its ~1MB captured corpus live outside the repo, in
an untracked regression-suite/ directory, so the differences it
documents are recorded once as prose rather than carried as a megabyte
of fixtures through every clone and every review.
/list/datasets and /get/dataset moved to WS4 PR01, so the five cases that
exercise them go with the endpoints rather than testing routes this
branch no longer serves.

Case count drops 63 to 58: three from get.test.ts and two from
list.test.ts. Any other movement in that number is a real regression,
not this commit.

Refs: upgrade-plans/07-strip-admin-surface-from-ws1.md
@calmacx
calmacx merged commit 53dc6b5 into dev Sep 23, 2026
4 checks passed
@calmacx
calmacx deleted the feat/GAT-9592-tests branch September 23, 2026 08:55

This branch was successfully deployed

1 active deployment
dev — b1ae17ec Deployed Sep 22, 2026 by calmacx via testing #728
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.

2 participants