test(e2e-prod): per-suite correctness sweeps + nits#169
Merged
Conversation
Companion to PR #168 (the harness + contract-assertion hardening). This is the broader correctness sweep from the same review: smaller issues that aren't critical-class but undermine specific tests' ability to actually verify what their names claim. Per-suite fixes: 01-basic.test.ts - Remove unused `before` import. 02-authz.test.ts - "cross-tenant DELETE" had dead code: the assert.ok above already throws on non-4xx, so the explicit 200/204 check could never run. Reordered: hard-fail on 200/204 first (and assert.fail() so node:test sees the regression), then the 4xx ok-range assertion. 08-mcp.test.ts + 12-mcp-extended.test.ts - Replace hardcoded absolute path to mcp/dist/index.js with a repo-relative default + E2A_MCP_DIST env override. The hardcoded path was `/Users/joshzhang/Desktop/e2a/...` — broke for any other contributor or CI environment. 09-postfix.test.ts - The "/send 429 Retry-After" test was a pure no-op recording an `info()` skip — but it counted as a passing test in the totals and inflated the green count. Marked test.skip() so it shows up correctly in the spec-reporter output. The reason (avoiding fan- out of 60+ HITL notification emails) is preserved in the comment. 11-messaging.test.ts (reply-empty) - Previous candidate selection (`/api/v1/messages` user-scoped + fallback to any direction) routinely picked an outbound message, which 404'd at the /reply endpoint (reply only operates on inbound). The 404 satisfied the `>= 400 && < 500` assert so the test passed without ever testing the "empty body returns 400" branch. Now uses the agent-scoped inbound listing and asserts the exact 400; if a listing-vs-storage skew causes a 404 on an id we just listed, that surfaces as info() rather than masking the empty-body check. 13-billing-surface.test.ts - usage-agents drift tolerance was purely informational at any size. Now: ±1 is silently fine (timing race), >1 records info() with detail, but >3 hard-fails as a real counter-staleness regression. Smoke against prod passes with all changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to #168 (the harness + critical assertion hardening). This is the broader correctness sweep — smaller issues that aren't critical-class but each undermines a specific test's ability to verify what its name claims.
Per-suite changes
Why two PRs
PR #168 is the high-leverage harness + critical-class assertions — narrow and easy to land. This PR is broader (touches 7 files) and worth reviewing independently.
Test plan