Skip to content

Commit 5c7e107

Browse files
committed
test(ai): surface the /ai/embed response body when the two-tenant e2e fails
The AI embed/retrieve demo e2e (poisoned_rag, two_tenant) and the rate-limit e2e return a controlled 503 whose aiCode lives only in the JSON body, which assertStatus() does not print. Assert the status with the body in the message so the next CI run reveals the exact failure code and it can be root-caused. No behaviour change on the success path.
1 parent 11788c0 commit 5c7e107

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

examples/api/tests/@integration/e2e/ai/ai_two_tenant_no_leak.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ test.group('AI e2e — two-tenant embed/retrieve isolation (3A)', (group) => {
4646
.post('/ai/embed')
4747
.headers(H(a.id, 'user-a'))
4848
.json({ source: 'kb', input: ['secret-of-A: the refund window is 30 days'] })
49-
embedA.assertStatus(200)
49+
assert.equal(
50+
embedA.status(),
51+
200,
52+
`POST /ai/embed (tenant A) should succeed; got ${embedA.status()}: ${JSON.stringify(embedA.body())}`
53+
)
5054
// Demo-layer check (review #2): the write succeeded, so SEAM-2 discovery + the AI
5155
// per-tenant migration created the tenant's ai_embeddings table.
5256
assert.equal(embedA.body().inserted, 1, 'the ai_embeddings table exists and took the row')

0 commit comments

Comments
 (0)