Skip to content

Commit 67a30be

Browse files
committed
test: inference-testing fakes, e2e retry, base64 and live suites (CL-9107)
Units shrink to index placement, short reply, and base64 decode, driven by @intx/inference-testing instead of hand-rolled fetch/scheduler fakes. tests/ adds a 429-then-200 retry on the harness clock and a 401 that does not retry, a base64-vs-float check over a real HTTP stub, and a live /v1/embeddings round trip that skips when no server is reachable. Also closes CL-9132, CL-9114, CL-9116, CL-9137.
1 parent 4160177 commit 67a30be

8 files changed

Lines changed: 250 additions & 321 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
bun-version: latest
2222
- run: bun install --frozen-lockfile
2323
- run: bunx tsc --noEmit
24-
- run: bun test ./src
25-
- run: bunx prettier --check src
24+
- run: bun run test
25+
- run: bunx prettier --check src tests
2626
- run: bun run build
2727
- name: Import packed dist with Node
2828
run: |

‎IMPLEMENTATION.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@ package depends only on the published surface).
102102

103103
## Tests
104104

105-
`bun run test` is `bun test ./src`. Coverage is the client contract: empty
106-
input, URL and body knobs, auth header presence, batch split and order,
107-
`batchSize` rejection, malformed / short / duplicate-index replies,
108-
index-not-position placement, 429 retry, 401 abort, `probeEmbedDims`,
109-
overridable `Retry-After`.
105+
`bun run test` runs `bun test ./src ./tests`.
106+
107+
- `src/embed.test.ts` — units on `@intx/inference-testing` fakes: index
108+
placement across batches, short reply, base64 decode.
109+
- `tests/retry.test.ts` — 429 retried once after `Retry-After` on the
110+
harness clock; 401 rejects without retry.
111+
- `tests/base64.test.ts` — `base64` and `float` agree over a real HTTP stub.
112+
- `tests/live.test.ts` — round trip against a real `/v1/embeddings`
113+
(`EMBEDDING_E2E_BASE_URL`, default local Ollama; `EMBEDDING_E2E_MODEL`,
114+
default `nomic-embed-text`). Skips when unreachable.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"build": "tsc -p tsconfig.build.json",
1818
"prepack": "bun run build",
1919
"typecheck": "tsc --noEmit",
20-
"test": "bun test ./src",
20+
"test": "bun test ./src ./tests",
2121
"format": "prettier -w ."
2222
},
2323
"dependencies": {

0 commit comments

Comments
 (0)