- WORKOS_API_URL / AUTUMN_API_URL env seams point the REAL SDKs (incl. the vault plugin via credentials.apiUrl) at the vendored emulators. Production composition is unconditional again — the EXECUTOR_E2E_STUB layer swap and every *.test-layer.ts are deleted. - e2e cloud target: identities minted through the REAL login flow (login → emulator-hosted AuthKit, headless via login_hint → callback → genuine sealed-session cookie), orgs through the real create-organization route. - MCP_AUTHKIT_DOMAIN points at the emulator's OAuth authorization server — cloud MCP OAuth e2e now RUNS (was capability-skipped): 19/19 scenarios, zero skips across both targets. - Readiness probes wait for /api/auth/login to actually 302 (vite serves the SPA for /api/* during cold compile); submenu interactions wait for the loaded sub-content before clicking.
Showing the changes to apps/cloud/src/testing (1 of 22 files). Show all
Unified · Split
| @@ -1,21 +0,0 @@ | |||
| 1 | // Env-gated stub layers that turn `vite dev` into a fully-stubbed, logged-in | ||
| 2 | // instance — one target every surface (browser / API / MCP / CLI) can drive, | ||
| 3 | // replacing the bespoke in-process harnesses + e2e-server wiring. | ||
| 4 | // | ||
| 5 | // Enabled by `EXECUTOR_E2E_STUB=1`. NEVER set in production — when unset, the | ||
| 6 | // served route composition is byte-for-byte the real `*Live` layers. | ||
| 7 | import { WorkOSTestLayer, makeWorkOSTestState } from "../auth/workos.test-layer"; | ||
| 8 | import { AutumnTestLayer, makeAutumnTestState } from "../extensions/billing/service.test-layer"; | ||
| 9 | |||
| 10 | export const E2E_STUB = process.env.EXECUTOR_E2E_STUB === "1"; | ||
| 11 | |||
| 12 | // Multi-user stub WorkOS: the `wos-session` cookie value IS the user id, with | ||
| 13 | // per-user membership buckets — so each test/browser picks a fresh user and is | ||
| 14 | // isolated on the one shared instance (no reset). Swapped in for | ||
| 15 | // `CoreSharedServices`, it authenticates every surface (session routes, | ||
| 16 | // /account/me, SSR) with no real WorkOS. | ||
| 17 | const workos = makeWorkOSTestState({ memberships: [], multiUser: true }); | ||
| 18 | const autumn = makeAutumnTestState({}); // no paid subscription → free plan → 3-org limit applies | ||
| 19 | |||
| 20 | export const E2EStubWorkOSLayer = WorkOSTestLayer(workos); | ||
| 21 | export const E2EStubAutumnLayer = AutumnTestLayer(autumn); | ||