test(router): run the parity differential on Deno, Bun and workerd
The matcher comparison does not depend on the runtime, so it should run on every
runtime core supports. Only the Node suite ran it before.
The comparison and the app.fetch fixtures move into differential.ts and
app-fixture.ts, which use neither vitest nor a file API. Each runtime passes in
a loader for the frozen JSON. The vitest files use the same modules, plus a
Node check that the neutral runners report no mismatch, so the two paths cannot
drift.
- Deno and Bun: test/{deno,bun}/router-parity.test.ts run all 1158 frozen
matcher cases (hand-picked, owner, generated v1 and v2, WS) through the oracle
and the live router, plus the 55 app.fetch cases.
- workerd: test/edge/parity-worker.ts bundles the frozen JSON and runs the
same checks; test/edge/run.ts adds the phase after its existing assertions.
The Node-socket, WS-upgrade, boot and mesh captures stay Node-only: they need
http.request, the ws client, or a mesh peer on a port.
Refs #109
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
11 files changed
+553
-247
No files matched your search
@@ -49,4 +49,19 @@ Application-level, WS, boot and introspection files are compared against the liv
|
||||
because there is no second implementation of `app.fetch` to diff against; the frozen capture plays
|
||||
the oracle's role.
|
||||
|
||||
### On every runtime
|
||||
|
||||
`differential.ts` and `app-fixture.ts` hold the same comparison with no vitest and no file API, so
|
||||
it runs unchanged on Deno (`test/deno/router-parity.test.ts`), Bun (`test/bun/router-parity.test.ts`)
|
||||
and workerd (`test/edge/parity-worker.ts`, driven by `test/edge/run.ts`). Each runtime runs every frozen
|
||||
matcher case through both the oracle and the live router, plus the `app.fetch` cases from
|
||||
`app-fetch.json` and `owner-app-allow.json`. The Node-socket, WS-upgrade, boot and mesh files stay
|
||||
Node-only: they need `http.request`, the `ws` client, or a mesh peer listening on a port.
|
||||
|
||||
### Mutation check
|
||||
|
||||
`npm run parity:mutants` (not part of `npm test`) applies targeted mutants modelling likely radix
|
||||
bugs to a temporary copy of `src/`, runs this suite against each, and reports which were killed.
|
||||
`src/` itself is never modified.
|
||||
|
||||
The performance half of the baseline is in `bench/lookup.ts` and `bench/baseline/router-ed47836/`.
|
||||
Reference in new issue
Block a user