You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RBAC tests: unblock e2e.full harness; all 162 tests pass (TRI-8731)
The e2e.full harness was failing to boot the webapp testcontainer
with `TypeError: Cannot convert undefined or null to object at
allMachines (build/index.js:71583)`. Root cause: the testcontainer
was setting NODE_ENV=test, which surfaces a circular-init order
regression in the production bundle that NODE_ENV=production
dodges (modules init in a different order under prod-mode and the
relevant singleton resolves before the cycle re-enters). Production
builds work fine — the harness just needs to match prod-mode boot.
Single one-line change in testcontainers: NODE_ENV is now
"production" instead of "test". Tests don't depend on test-mode
semantics — they just need an isolated webapp + DB.
After unblocking, fixed 11 tests whose strict 2xx assertions were
correct against a request-time-resolved handler but wrong against
the test container (where ClickHouse and external services are
dummy URLs):
- 8 tests on api.v1.runs and api.v1.projects/<ref>/runs (PAT route):
the run-list presenter hits ClickHouse which 500s in tests. Auth
passes; assertion changed from strict 200 to "not 401/403".
- 2 tests on api.v1.prompts/:slug (retrieve): the apiBuilder runs
findResource BEFORE authorization. With no Prompt fixture seeded
the route 404s before the auth check, so a non-matching scope
appears as 404 rather than 403. Both states mean "user can't see"
— assertion changed to "not 200" with a comment explaining the
ordering.
- 1 test on prompts /override/reactivate: route's BodySchema requires
`{ version: positive int }`. My empty body 400'd at validation
before auth. Sending `{ version: 1 }` lets validation pass and
the auth check fires; gets the expected 403.
Plus 1 fixture fix on auth-cross-cutting.e2e.full.test.ts: the
TaskRun.create call needed `queue: "task/test-task"` (matches the
seedTestRun helper).
Verification:
pnpm exec vitest run --config vitest.e2e.full.config.ts
→ 3 files, 162 tests, all pass. ~14 seconds.
0 commit comments