Skip to content

test: embed and rerank clients against a local HTTP server - #58

Merged
TheGreatAxios merged 1 commit into
cl-9176-memory-rewrite-readme-opening-to-say-what-it-isfrom
cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9176-memory-rewrite-readme-opening-to-say-what-it-isfrom
cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #57; merge that first.

  • src/core/embed-client.test.ts and src/core/rerank-client.test.ts, which asserted against a mocked fetch, are replaced by tests/embed-client.test.ts and tests/rerank-client.test.ts.
  • Both run the real clients against a local Bun.serve stub (tests/lib/http-stub.ts) and check the path, auth header and JSON body the endpoint receives.
  • Coverage carries over case for case: every wire shape, the bearer token, batching, HTTP errors, timeouts, the dims probe, rerank truncation and query reserve, and trimming. The validateRerankConfig cases move with the rerank tests.
  • test:coverage now includes ./tests.

Verification

  • bun run typecheck passes.
  • bun run test passes (411 pass; the Postgres suites skip without TEST_DATABASE_URL).

Closes CL-9127

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review, three passes.

Verdict: ready for review.

  • Every deleted case has an HTTP-level equivalent.
  • The stub resets its reply and recorded requests between tests.
  • The one waiver is listed in the description.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests branch from a5fbf41 to 174bb6f Compare September 25, 2026 18:31
@TheGreatAxios
TheGreatAxios force-pushed the cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests branch 2 times, most recently from 665b84e to 6698c17 Compare September 26, 2026 00:53
@TheGreatAxios
TheGreatAxios force-pushed the cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests branch from 6698c17 to 1ccffbe Compare September 26, 2026 01:32
@TheGreatAxios TheGreatAxios changed the title Test the embed and rerank clients against a local HTTP server test: embed and rerank clients against a local HTTP server Sep 26, 2026
@TheGreatAxios
TheGreatAxios force-pushed the cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests branch from 1ccffbe to e45e5fd Compare September 26, 2026 01:36
@TheGreatAxios
TheGreatAxios added this pull request to stack #61 September 26, 2026 01:57
The clients now send real requests to a Bun.serve stub instead of a
mocked fetch, so each test checks the wire shape, headers and body the
endpoint actually receives. The rerank config validation tests move
with them.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9127-memory-delete-mocked-embed-client-and-rerank-client-tests branch from e45e5fd to a0f8a3f Compare September 27, 2026 00:32
@TheGreatAxios
TheGreatAxios merged commit 9a273cc into main Sep 27, 2026
4 checks passed
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