diff --git a/ai/context/decisions.md b/ai/context/decisions.md index 2f5c1f9..ea030a9 100644 --- a/ai/context/decisions.md +++ b/ai/context/decisions.md @@ -49,6 +49,12 @@ Last updated: 2026-05-26 was already producing drift against `orun-cloud`. The tag is pinned, never `latest`, so a catalog release cannot change this repo's execution contracts without a commit here. +- The pin is stack-tectonic 0.20.1 (2026-10-27), the first release whose + `turbo-package` runs a component's `preBuildCommand`: 0.18.1 through 0.20.0 + guarded pre-build, build and typecheck on keys orun never sets, so every + suite's tests skipped themselves (sourceplane/stack-tectonic#20). The fix + went upstream rather than into an in-tree copy, which this repo carried for a + day before the release. - All component types use `spec.parameters` instead of `spec.inputs` on the current Orun runtime. - Cloudflare/Supabase human-provided resources discovered in Task 0002 remain diff --git a/docs/components/REVIEW.md b/docs/components/REVIEW.md index 975bff4..2c64f71 100644 --- a/docs/components/REVIEW.md +++ b/docs/components/REVIEW.md @@ -85,9 +85,9 @@ Distribution: **5/5**: 6 · **4/5**: 30 · **3/5**: 9. consumed by the components below at build time"), which is true of all seven and says nothing about any. Each now opens with what it actually is. -## The finding that is not a documentation problem +## The finding that was not a documentation problem -**26 components subscribe with `profile: quick-check`, and that profile runs no +**26 components subscribed with `profile: quick-check`, and that profile runs no tests.** **Observed directly**, on the pull request that added this page — lumen's own CI, not an inherited note. The `db-tests · dev · Verify` lane ([run 40296065423](https://github.com/sourceplane/lumen/actions/runs/40296065423)) @@ -117,17 +117,149 @@ This repository had already written the finding down, in > setup, install and a package-structure check — and no tests (observed live > on cirrus: `4 passed, 0 failed`, none of them a test). -Sixteen of the 26 are test suites whose tests live in `preBuildCommand`, which -`quick-check` skips. +**What the two profiles actually are**, read from stack-tectonic 0.20.0's own +`turbo-package` definitions rather than inferred: -The fix is one word per component — `profile: verify` — and it is **not in this -change on purpose**: flipping it turns on sixteen suites that have never run in -CI, and the right place to absorb that is a change that can watch what it -turns on, not one that is also moving the build's timings. orun-cloud hit the -identical hole and recorded it as the `packages/db` lesson (#1536); its test -components now say `verify` for exactly this reason. +| capability | `quick-check` | `verify` | +|---|---|---| +| setup-node, setup-pnpm, install | ✓ | ✓ | +| verify-structure | ✓ | ✓ | +| **pre-build** — where every suite here keeps its tests | — | ✓ | +| **build** | — | ✓ | +| **typecheck** | — | ✓ | + +So `quick-check` skipped not only the tests but the build and typecheck as well. + +### Two fixes, not one: the profile, and a guard in the composition + +Flipping the profile was necessary and not sufficient. The pull request that +flipped it went green, and its `db-tests` lane reported seven steps where it +used to report four — exactly `verify`'s count. Neither of those is evidence +that a test ran, so the log was read: + +``` +✓ 04 pre-build 0.0s · Skipping pre-build. +✓ 06 build-package 3.8s +✓ 07 typecheck-package 2.3s +``` + +Pre-build skipped itself, for every component, whatever it declared. The guard +in stack-tectonic 0.20.0's `turbo-package` verify job reads a key orun never +sets: + +``` +{{if .preBuildCommand}} ← orun's context has .orun, .parameters, .env +{{.parameters.preBuildCommand}} ← where the value actually is +{{else}} +echo "Skipping pre-build." +``` + +`buildCommand` and `typecheckCommand` have the same mistake and only appear to +work: their guards are equally always-false, and their `else` defaults happen to +be the commands every component here declares. Pre-build has no default, so it is +the one that visibly breaks. + +**The fix is upstream, in stack-tectonic 0.20.1** +([sourceplane/stack-tectonic#20](https://github.com/sourceplane/stack-tectonic/pull/20)): +the three guards read `.parameters.*`, and that repository's `verify.sh` now +refuses a guard on any key outside `.orun`, `.parameters` and `.env` and renders +`turbo-package` through the packed artifact to check its commands come out. Every +release from 0.18.1 to 0.20.0 carried the bug, and every structural check passed +them. This repository pins 0.20.1; for a day it carried an in-tree copy of the +fixed composition instead, and that copy is gone. + +**No other baseline changes with it.** Each of the other 25 baselines on +stack-tectonic was planned with its own pin, as published and with only the three +guards patched: 181 `turbo-package` jobs across the 22 that have any, all on +`quick-check`, which plans none of the three steps, and not one step differs. No +consumer declares a custom `buildCommand` or `typecheckCommand`. + +**Checked by rendering, not by reading.** `orun plan --all-envs` on 0.20.0 and +on 0.20.1: 92 jobs and 610 steps either way, and exactly 19 steps differ — the +pre-build of the nineteen components below, from `echo "Skipping pre-build."` to +`pnpm exec turbo run test --filter=./`. + +### The profile, and the suites made ready to run + +Nineteen components carry tests in `preBuildCommand`: the **seventeen** +`tests/*` suites and two packages with their own, `cli` and `sdk`. An earlier +draft of this page said sixteen; it was counting the overviews that read +`None`, and `platform-limits-tests` is a seventeenth suite with a real overview. + +All nineteen now say `profile: verify` on `dev`, the only environment the +suites subscribe to and the one a pull request plans. `cli` and `sdk` keep +`quick-check` on `stage` and `prod`: a package does not deploy, so those rows +are its seat in each environment's graph, and running identical tests three +times would buy nothing. That matches how lumen's workers already subscribe — +plain `verify` on `dev`, with no rule skipping it on main. + +**Before flipping anything, all nineteen were run locally exactly as `verify`'s +pre-build step runs them** (`pnpm exec turbo run test --filter=./` in each +component). Fourteen passed. Five did not, and in every case the test was right +about what it guards and its harness had drifted from the code underneath it. +The fifth was found by CI rather than locally: `web-console-next-tests` passed +here only from jest's transform cache, and its first real run, in a lane, could +not load four of its files. Every suite has since been re-run with no turbo +cache and an empty jest cache, in a tree staged the way orun stages a job. + +| suite | what it hit | the fix | +|---|---|---| +| `api-edge-tests` | 12 tests read `apps/api-edge/wrangler.jsonc`, which no longer exists — each worker commits `wrangler.template.jsonc` and `tooling/wire/render.mjs` renders the deployable file (BF6) | read the template, which carries exactly the bindings asserted | +| `membership-worker-tests` | the same file, read at `describe` time, so the whole suite failed to load | the same | +| `db-tests` | `tsconfig.json` enumerates thirteen `@saas/db/*` subpaths and not `integrations`; jest resolved it through its `(.*)` catch-all, ts-jest's type-check did not | add the path | +| `integrations-worker-tests` | `tsconfig.json` maps `@saas/db/*`, which does not match bare `@saas/db` | add the path | +| `web-console-next-tests` | the console's sources import `@saas/sdk`; the suite's tsconfig and jest mapper named only `@saas/contracts`, so ts-jest could not resolve it and four files failed to load | map `@saas/sdk` to the sdk's source | + +**And one that only a CI runner shows.** Eighteen test files across the worker +suites faked the database as `postgres://fake`. The list handlers read the +database concurrently with the membership call (PERF12) and wait for both, so +every such request made a real DNS lookup of the hostname `fake`. That fails in +milliseconds on a workstation; on a runner whose resolver does not answer it +waits out glibc's 5-second timeout, which is exactly jest's, and +`config-worker-tests` failed that way on its second CI run having passed its +first. Each now reads `postgres://fake@127.0.0.1:1/fake`, a closed loopback port +the kernel refuses at once with no lookup. Checked by delaying every lookup but +`localhost` by six seconds: the old URL times out seventeen tests in +config-worker alone, and with the change all nineteen suites pass with none. + +The suites that failed *to load* were hiding more than their failure counts +showed: `membership-worker-tests` went from 85 tests to **269**, `db-tests` from +552 to **578**, `integrations-worker-tests` from 70 to **77**, +`web-console-next-tests` from 215 to **258**. **3,088 tests across the +nineteen**, every one passing on the finished tree. + +**The repointed binding tests guard something real**, which was checked by +breaking it: pointing stage's `IDENTITY_WORKER` at `lumen-identity-worker-prod` +fails exactly the two tests written for it ("has stage service binding to +lumen-identity-worker-stage", "stage does not bind to prod identity worker"). +A cross-environment binding would route stage traffic into prod's workers. + +Not every `wrangler.jsonc` reference was rot. `config-worker-tests` renders the +template itself into a temporary file, `platform-limits-tests` tries the +template first, and `policy-worker` binds nothing, so it never moved to a +template and its `wrangler.jsonc` is real. None of those passes was vacuous. + +### Left on `quick-check`, by design + +`contracts`, `db`, `notifications-client`, `policy-engine`, `shared`, +`testing`, `webhook-verifier`. None has a `preBuildCommand`: their tests live +in the matching `tests/*` suite, which builds and typechecks them on every plan +that includes it. Moving them to `verify` would add their own build and +typecheck lanes — defensible, but a different change from making tests run. + +### What this costs a build + +Nothing, during a bootstrap. The nineteen verify on `dev` only, and a +bootstrap runs no `dev` lane: a landing's pull request is checked by `plan` +alone (`ci.yml` skips lanes on `orun/BASE-*`), and `01-scaffold` defers `dev`'s +push-to-main trigger until `08-docs` restores it +(`tooling/bootstrap/dev-lanes.mjs`). So the 18 measured minutes in +`docs/phases/TIMINGS.md` stand. An earlier draft of this section predicted the +suites would add to four phases' merge convergences; it had missed the defer. -Components on `quick-check`: `admin-worker-tests`, `api-edge-tests`, `billing-worker-tests`, `cli`, `config-worker-tests`, `contracts`, `contracts-tests`, `db`, `db-tests`, `identity-worker-tests`, `integrations-worker-tests`, `membership-worker-tests`, `metering-worker-tests`, `notifications-client`, `notifications-client-tests`, `notifications-worker-tests`, `platform-limits-tests`, `policy-engine`, `policy-engine-tests`, `policy-worker-tests`, `projects-worker-tests`, `sdk`, `shared`, `testing`, `web-console-next-tests`, `webhook-verifier`. +After the bootstrap they run on every pull request and every merge to main, a +lane per suite beside the deploys. On this pull request's CI each suite's +pre-build took 3 to 13 seconds. ## Declared product URLs diff --git a/docs/phases/TIMINGS.md b/docs/phases/TIMINGS.md index d7db482..73a59d2 100644 --- a/docs/phases/TIMINGS.md +++ b/docs/phases/TIMINGS.md @@ -55,6 +55,16 @@ slow case rather than the fast one. What could still make a build slower than one condition on `06-console` below. A second measured run belongs on this page beside the first rather than replacing it. +**The test suites cost a bootstrap nothing.** Nineteen components moved from +`quick-check` to `verify`, and `turbo-package`'s pre-build guard, which skipped +every suite's tests, is fixed in stack-tectonic 0.20.1 (`docs/components/REVIEW.md`). All +nineteen verify on `dev` only, and a bootstrap runs no `dev` lane: each +landing's pull request is checked by `plan` alone (`ci.yml` skips lanes on +`orun/BASE-*`), and `01-scaffold` defers `dev`'s push-to-main trigger until +`08-docs` restores it (`tooling/bootstrap/dev-lanes.mjs`). The 18 minutes +stand. The suites run from the product's first pull request on, and on every +merge to main after `08-docs`, each in its own lane beside the deploys. + **One condition on `06-console`'s 2.** The console is fetched only when the baseline tag being built from has a published artifact for exactly these sources — `.github/workflows/tag.yml` publishes one as part of cutting a tag. diff --git a/intent.yaml b/intent.yaml index 719641d..f065ced 100644 --- a/intent.yaml +++ b/intent.yaml @@ -50,7 +50,7 @@ compositions: # a commit here. Bumping the tag is the deliberate upgrade step. - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/stack-tectonic:0.20.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.20.1 resolution: precedence: - stack-tectonic diff --git a/packages/cli/component.yaml b/packages/cli/component.yaml index 5e1ddec..2e66359 100644 --- a/packages/cli/component.yaml +++ b/packages/cli/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify - name: stage profile: quick-check - name: prod diff --git a/packages/sdk/component.yaml b/packages/sdk/component.yaml index e86069e..b52154f 100644 --- a/packages/sdk/component.yaml +++ b/packages/sdk/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify - name: stage profile: quick-check - name: prod diff --git a/tests/admin-worker/component.yaml b/tests/admin-worker/component.yaml index 8fccd10..343ff5a 100644 --- a/tests/admin-worker/component.yaml +++ b/tests/admin-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/admin-worker/docs/overview.md b/tests/admin-worker/docs/overview.md index 7a80367..4586573 100644 --- a/tests/admin-worker/docs/overview.md +++ b/tests/admin-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `admin-worker` on ever plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/admin-worker/src/list-entitlement-decisions.test.ts b/tests/admin-worker/src/list-entitlement-decisions.test.ts index 71dc2b3..470d9f0 100644 --- a/tests/admin-worker/src/list-entitlement-decisions.test.ts +++ b/tests/admin-worker/src/list-entitlement-decisions.test.ts @@ -11,7 +11,8 @@ import type { function createFakeEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, }; } diff --git a/tests/admin-worker/src/list-support-actions.test.ts b/tests/admin-worker/src/list-support-actions.test.ts index 1944ed3..edf0c06 100644 --- a/tests/admin-worker/src/list-support-actions.test.ts +++ b/tests/admin-worker/src/list-support-actions.test.ts @@ -13,7 +13,8 @@ import type { function createFakeEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, }; } diff --git a/tests/admin-worker/src/lookup-support.test.ts b/tests/admin-worker/src/lookup-support.test.ts index ade7fcf..a84beb9 100644 --- a/tests/admin-worker/src/lookup-support.test.ts +++ b/tests/admin-worker/src/lookup-support.test.ts @@ -14,7 +14,8 @@ import type { function createFakeEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, }; } diff --git a/tests/admin-worker/src/record-support-action.test.ts b/tests/admin-worker/src/record-support-action.test.ts index d6cb89f..328500c 100644 --- a/tests/admin-worker/src/record-support-action.test.ts +++ b/tests/admin-worker/src/record-support-action.test.ts @@ -10,7 +10,8 @@ import type { function createFakeEnv(overrides: Partial = {}): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, ...overrides, }; } diff --git a/tests/api-edge/component.yaml b/tests/api-edge/component.yaml index 590f5d0..e05a288 100644 --- a/tests/api-edge/component.yaml +++ b/tests/api-edge/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/api-edge/docs/overview.md b/tests/api-edge/docs/overview.md index 4cfa79d..0e42f9f 100644 --- a/tests/api-edge/docs/overview.md +++ b/tests/api-edge/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `api-edge` on every plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/api-edge/src/auth-facade.test.ts b/tests/api-edge/src/auth-facade.test.ts index dc7db18..ed85503 100644 --- a/tests/api-edge/src/auth-facade.test.ts +++ b/tests/api-edge/src/auth-facade.test.ts @@ -576,8 +576,8 @@ describe("api-edge auth facade", () => { }); describe("config verification", () => { - it("wrangler.jsonc has stage service binding to lumen-identity-worker-stage", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has stage service binding to lumen-identity-worker-stage", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -588,8 +588,8 @@ describe("api-edge auth facade", () => { expect(identity.service).toBe("lumen-identity-worker-stage"); }); - it("wrangler.jsonc has prod service binding to lumen-identity-worker-prod", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has prod service binding to lumen-identity-worker-prod", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -601,7 +601,7 @@ describe("api-edge auth facade", () => { }); it("stage does not bind to prod identity worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -612,7 +612,7 @@ describe("api-edge auth facade", () => { }); it("prod does not bind to stage identity worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); diff --git a/tests/api-edge/src/org-facade.test.ts b/tests/api-edge/src/org-facade.test.ts index 86be609..882a3c6 100644 --- a/tests/api-edge/src/org-facade.test.ts +++ b/tests/api-edge/src/org-facade.test.ts @@ -433,8 +433,8 @@ describe("api-edge org facade", () => { }); describe("binding verification config", () => { - it("wrangler.jsonc has stage MEMBERSHIP_WORKER binding to lumen-membership-worker-stage", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has stage MEMBERSHIP_WORKER binding to lumen-membership-worker-stage", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -445,8 +445,8 @@ describe("api-edge org facade", () => { expect(membership.service).toBe("lumen-membership-worker-stage"); }); - it("wrangler.jsonc has prod MEMBERSHIP_WORKER binding to lumen-membership-worker-prod", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has prod MEMBERSHIP_WORKER binding to lumen-membership-worker-prod", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -458,7 +458,7 @@ describe("api-edge org facade", () => { }); it("stage does not bind to prod membership worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -470,7 +470,7 @@ describe("api-edge org facade", () => { }); it("prod does not bind to stage membership worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); diff --git a/tests/api-edge/src/project-facade.test.ts b/tests/api-edge/src/project-facade.test.ts index 26ef2dd..b3a4b80 100644 --- a/tests/api-edge/src/project-facade.test.ts +++ b/tests/api-edge/src/project-facade.test.ts @@ -836,8 +836,8 @@ describe("api-edge project facade", () => { }); describe("binding verification config", () => { - it("wrangler.jsonc has stage PROJECTS_WORKER binding to lumen-projects-worker-stage", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has stage PROJECTS_WORKER binding to lumen-projects-worker-stage", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -848,8 +848,8 @@ describe("api-edge project facade", () => { expect(projects.service).toBe("lumen-projects-worker-stage"); }); - it("wrangler.jsonc has prod PROJECTS_WORKER binding to lumen-projects-worker-prod", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + it("wrangler.template.jsonc has prod PROJECTS_WORKER binding to lumen-projects-worker-prod", () => { + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -861,7 +861,7 @@ describe("api-edge project facade", () => { }); it("stage does not bind to prod projects worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); @@ -873,7 +873,7 @@ describe("api-edge project facade", () => { }); it("prod does not bind to stage projects worker", () => { - const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.jsonc"); + const configPath = resolve(__dirname, "../../../apps/api-edge/wrangler.template.jsonc"); const raw = readFileSync(configPath, "utf-8"); const config = JSON.parse(stripJsoncComments(raw)); diff --git a/tests/billing-worker/component.yaml b/tests/billing-worker/component.yaml index e5e5ec1..d372f13 100644 --- a/tests/billing-worker/component.yaml +++ b/tests/billing-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/billing-worker/docs/overview.md b/tests/billing-worker/docs/overview.md index a55069b..c75b082 100644 --- a/tests/billing-worker/docs/overview.md +++ b/tests/billing-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `billing-worker` on ev plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/billing-worker/src/billing-worker.test.ts b/tests/billing-worker/src/billing-worker.test.ts index fd1660f..78841f3 100644 --- a/tests/billing-worker/src/billing-worker.test.ts +++ b/tests/billing-worker/src/billing-worker.test.ts @@ -49,7 +49,8 @@ function createMockFetcher( function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [ diff --git a/tests/config-worker/component.yaml b/tests/config-worker/component.yaml index 4f4a020..915136e 100644 --- a/tests/config-worker/component.yaml +++ b/tests/config-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/config-worker/docs/overview.md b/tests/config-worker/docs/overview.md index f33c02b..3850bab 100644 --- a/tests/config-worker/docs/overview.md +++ b/tests/config-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `config-worker` on eve plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/config-worker/src/config-worker.test.ts b/tests/config-worker/src/config-worker.test.ts index 1517a49..9d7332e 100644 --- a/tests/config-worker/src/config-worker.test.ts +++ b/tests/config-worker/src/config-worker.test.ts @@ -56,7 +56,8 @@ function createMockFetcherThatThrows(): Fetcher { function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), ENVIRONMENT: "test", diff --git a/tests/contracts/component.yaml b/tests/contracts/component.yaml index 7731681..3e1dc0c 100644 --- a/tests/contracts/component.yaml +++ b/tests/contracts/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "20" pnpmVersion: "10.12.1" diff --git a/tests/contracts/docs/overview.md b/tests/contracts/docs/overview.md index 2dc539f..3e3af32 100644 --- a/tests/contracts/docs/overview.md +++ b/tests/contracts/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `contracts` on every plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/db/component.yaml b/tests/db/component.yaml index 0df8b5d..6c2911e 100644 --- a/tests/db/component.yaml +++ b/tests/db/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "20" pnpmVersion: "10.12.1" diff --git a/tests/db/docs/overview.md b/tests/db/docs/overview.md index 365270d..f3d312d 100644 --- a/tests/db/docs/overview.md +++ b/tests/db/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `db` on every plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/db/tsconfig.json b/tests/db/tsconfig.json index 648a251..fa7d6ba 100644 --- a/tests/db/tsconfig.json +++ b/tests/db/tsconfig.json @@ -9,6 +9,7 @@ "declarationMap": false, "baseUrl": ".", "paths": { + "@saas/db/integrations": ["../../packages/db/src/integrations/index.ts"], "@saas/db": ["../../packages/db/src/index.ts"], "@saas/db/hyperdrive": ["../../packages/db/src/hyperdrive/index.ts"], "@saas/db/identity": ["../../packages/db/src/identity/index.ts"], diff --git a/tests/identity-worker/component.yaml b/tests/identity-worker/component.yaml index cb87793..76f24e8 100644 --- a/tests/identity-worker/component.yaml +++ b/tests/identity-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/identity-worker/docs/overview.md b/tests/identity-worker/docs/overview.md index a2a0d72..2ff27de 100644 --- a/tests/identity-worker/docs/overview.md +++ b/tests/identity-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `identity-worker` on e plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/integrations-worker/component.yaml b/tests/integrations-worker/component.yaml index 712dc24..36b73c6 100644 --- a/tests/integrations-worker/component.yaml +++ b/tests/integrations-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/integrations-worker/docs/overview.md b/tests/integrations-worker/docs/overview.md index 3590fb7..16c9a96 100644 --- a/tests/integrations-worker/docs/overview.md +++ b/tests/integrations-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `integrations-worker` plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/integrations-worker/src/connect-flow.test.ts b/tests/integrations-worker/src/connect-flow.test.ts index 04f0dba..3d1758e 100644 --- a/tests/integrations-worker/src/connect-flow.test.ts +++ b/tests/integrations-worker/src/connect-flow.test.ts @@ -72,7 +72,8 @@ function billingFetcher(allowed: boolean, reason?: string): Fetcher { function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: membershipFetcher(), POLICY_WORKER: policyFetcher(true), BILLING_WORKER: billingFetcher(true), diff --git a/tests/integrations-worker/src/deliveries-api.test.ts b/tests/integrations-worker/src/deliveries-api.test.ts index 405473c..2d9dceb 100644 --- a/tests/integrations-worker/src/deliveries-api.test.ts +++ b/tests/integrations-worker/src/deliveries-api.test.ts @@ -41,7 +41,8 @@ function jsonFetcher(body: unknown): Fetcher { function createEnv(): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: jsonFetcher({ data: { memberships: [ diff --git a/tests/integrations-worker/src/free-tier.test.ts b/tests/integrations-worker/src/free-tier.test.ts index 677f4e0..00e7326 100644 --- a/tests/integrations-worker/src/free-tier.test.ts +++ b/tests/integrations-worker/src/free-tier.test.ts @@ -21,7 +21,8 @@ import type { SqlExecutor, SqlExecutorResult, SqlRow } from "@saas/db/hyperdrive function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, ...overrides, } as unknown as Env; } diff --git a/tests/integrations-worker/src/inbound-pipeline.test.ts b/tests/integrations-worker/src/inbound-pipeline.test.ts index f0761c6..e0365a5 100644 --- a/tests/integrations-worker/src/inbound-pipeline.test.ts +++ b/tests/integrations-worker/src/inbound-pipeline.test.ts @@ -35,7 +35,8 @@ function fakeExecutor(respond: SqlResponder): { executor: SqlExecutor; queries: function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, GITHUB_APP_ID: "4242", GITHUB_APP_SLUG: "sourceplane-test", GITHUB_APP_PRIVATE_KEY: "-----BEGIN PRIVATE KEY-----\nirrelevant\n-----END PRIVATE KEY-----", diff --git a/tests/integrations-worker/src/repo-links.test.ts b/tests/integrations-worker/src/repo-links.test.ts index 4922e76..f59cc24 100644 --- a/tests/integrations-worker/src/repo-links.test.ts +++ b/tests/integrations-worker/src/repo-links.test.ts @@ -45,7 +45,8 @@ function jsonFetcher(body: unknown): Fetcher { function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: jsonFetcher({ data: { memberships: [ diff --git a/tests/integrations-worker/src/router.test.ts b/tests/integrations-worker/src/router.test.ts index ca6b71e..b4b04d9 100644 --- a/tests/integrations-worker/src/router.test.ts +++ b/tests/integrations-worker/src/router.test.ts @@ -4,7 +4,8 @@ import type { Env } from "@integrations-worker/env"; function createFakeEnv(overrides?: Partial>): Env { const base: Record = { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, }; return { ...base, ...overrides } as unknown as Env; } diff --git a/tests/integrations-worker/src/token-broker.test.ts b/tests/integrations-worker/src/token-broker.test.ts index 43d51a7..3a56d14 100644 --- a/tests/integrations-worker/src/token-broker.test.ts +++ b/tests/integrations-worker/src/token-broker.test.ts @@ -59,7 +59,8 @@ beforeAll(async () => { function createEnv(overrides?: Partial>): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: jsonFetcher({ data: { memberships: [ diff --git a/tests/integrations-worker/tsconfig.json b/tests/integrations-worker/tsconfig.json index 3a0e0d5..2743d29 100644 --- a/tests/integrations-worker/tsconfig.json +++ b/tests/integrations-worker/tsconfig.json @@ -13,6 +13,7 @@ "declarationMap": false, "baseUrl": ".", "paths": { + "@saas/db": ["../../packages/db/src/index.ts"], "@saas/contracts": [ "../../packages/contracts/src/index.ts" ], diff --git a/tests/membership-worker/component.yaml b/tests/membership-worker/component.yaml index 5ea23b2..53cf33b 100644 --- a/tests/membership-worker/component.yaml +++ b/tests/membership-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/membership-worker/docs/overview.md b/tests/membership-worker/docs/overview.md index 501a2ca..7bc0833 100644 --- a/tests/membership-worker/docs/overview.md +++ b/tests/membership-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `membership-worker` on plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/membership-worker/src/authorization-context.test.ts b/tests/membership-worker/src/authorization-context.test.ts index db2d4ec..ea0e55a 100644 --- a/tests/membership-worker/src/authorization-context.test.ts +++ b/tests/membership-worker/src/authorization-context.test.ts @@ -6,7 +6,8 @@ import type { Env } from "@membership-worker/env"; function createFakeEnv(overrides: Partial = {}): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, ...overrides, }; } diff --git a/tests/membership-worker/src/membership-worker.test.ts b/tests/membership-worker/src/membership-worker.test.ts index ec882e7..7a3effb 100644 --- a/tests/membership-worker/src/membership-worker.test.ts +++ b/tests/membership-worker/src/membership-worker.test.ts @@ -1182,7 +1182,7 @@ describe("pagination", () => { describe("wrangler config", () => { const __dirname = path.dirname(fileURLToPath(import.meta.url)); - const raw = fs.readFileSync(path.resolve(__dirname, "../../../apps/membership-worker/wrangler.jsonc"), "utf8"); + const raw = fs.readFileSync(path.resolve(__dirname, "../../../apps/membership-worker/wrangler.template.jsonc"), "utf8"); // Strip single-line comments for JSONC parsing const config = JSON.parse(raw.replace(/^\s*\/\/.*$/gm, "")); diff --git a/tests/membership-worker/src/service-principal-bindings.test.ts b/tests/membership-worker/src/service-principal-bindings.test.ts index 4f4e5e8..11988e4 100644 --- a/tests/membership-worker/src/service-principal-bindings.test.ts +++ b/tests/membership-worker/src/service-principal-bindings.test.ts @@ -17,7 +17,8 @@ const SP_SUBJECT_ID = servicePrincipalSubjectId(SP_UUID); // sp_aaaaaaaabbbbcccc function createFakeEnv(overrides: Partial = {}): Env { return { ENVIRONMENT: "test", - PLATFORM_DB: { connectionString: "postgres://fake" } as unknown as Hyperdrive, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" } as unknown as Hyperdrive, ...overrides, }; } diff --git a/tests/metering-worker/component.yaml b/tests/metering-worker/component.yaml index 949fa2b..080fc7f 100644 --- a/tests/metering-worker/component.yaml +++ b/tests/metering-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/metering-worker/docs/overview.md b/tests/metering-worker/docs/overview.md index e4824d2..a7a2571 100644 --- a/tests/metering-worker/docs/overview.md +++ b/tests/metering-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `metering-worker` on e plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/metering-worker/src/metering-worker.test.ts b/tests/metering-worker/src/metering-worker.test.ts index 6d3a36f..7f8ff5d 100644 --- a/tests/metering-worker/src/metering-worker.test.ts +++ b/tests/metering-worker/src/metering-worker.test.ts @@ -34,7 +34,8 @@ function createMockFetcher(responseBody: unknown, status = 200): Fetcher & { fet function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), ENVIRONMENT: "test", diff --git a/tests/notifications-client/component.yaml b/tests/notifications-client/component.yaml index 890f1d9..a7e74ee 100644 --- a/tests/notifications-client/component.yaml +++ b/tests/notifications-client/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/notifications-client/docs/overview.md b/tests/notifications-client/docs/overview.md index cb8065e..0a348e0 100644 --- a/tests/notifications-client/docs/overview.md +++ b/tests/notifications-client/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `notifications-client` plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/notifications-worker/component.yaml b/tests/notifications-worker/component.yaml index b71e77a..56a2f6f 100644 --- a/tests/notifications-worker/component.yaml +++ b/tests/notifications-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/notifications-worker/docs/overview.md b/tests/notifications-worker/docs/overview.md index 99b84a3..a9397f3 100644 --- a/tests/notifications-worker/docs/overview.md +++ b/tests/notifications-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `notifications-worker` plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/platform-limits/component.yaml b/tests/platform-limits/component.yaml index 6060a43..8f401f2 100644 --- a/tests/platform-limits/component.yaml +++ b/tests/platform-limits/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/policy-engine/component.yaml b/tests/policy-engine/component.yaml index e4a704a..c7c67c9 100644 --- a/tests/policy-engine/component.yaml +++ b/tests/policy-engine/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/policy-engine/docs/overview.md b/tests/policy-engine/docs/overview.md index 00a7308..e4c6cc2 100644 --- a/tests/policy-engine/docs/overview.md +++ b/tests/policy-engine/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `policy-engine` on eve plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/policy-worker/component.yaml b/tests/policy-worker/component.yaml index 463c1ac..5e71eb9 100644 --- a/tests/policy-worker/component.yaml +++ b/tests/policy-worker/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/policy-worker/docs/overview.md b/tests/policy-worker/docs/overview.md index 042242f..2ea1114 100644 --- a/tests/policy-worker/docs/overview.md +++ b/tests/policy-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `policy-worker` on eve plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/projects-worker/component.yaml b/tests/projects-worker/component.yaml index 80481b6..e5ae58f 100644 --- a/tests/projects-worker/component.yaml +++ b/tests/projects-worker/component.yaml @@ -17,7 +17,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/tests/projects-worker/docs/overview.md b/tests/projects-worker/docs/overview.md index 0143f0b..190bf43 100644 --- a/tests/projects-worker/docs/overview.md +++ b/tests/projects-worker/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `projects-worker` on e plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/projects-worker/src/projects-worker.test.ts b/tests/projects-worker/src/projects-worker.test.ts index 636e91c..2f486af 100644 --- a/tests/projects-worker/src/projects-worker.test.ts +++ b/tests/projects-worker/src/projects-worker.test.ts @@ -58,7 +58,8 @@ function createMockFetcherThatThrows(): Fetcher { function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), // Default: billing-worker returns an allowed `limit.projects` decision with diff --git a/tests/web-console-next/component.yaml b/tests/web-console-next/component.yaml index d740088..c0b1404 100644 --- a/tests/web-console-next/component.yaml +++ b/tests/web-console-next/component.yaml @@ -16,7 +16,7 @@ spec: subscribe: environments: - name: dev - profile: quick-check + profile: verify parameters: nodeVersion: "20" pnpmVersion: "10.12.1" diff --git a/tests/web-console-next/docs/overview.md b/tests/web-console-next/docs/overview.md index 27e4156..8ce2a3c 100644 --- a/tests/web-console-next/docs/overview.md +++ b/tests/web-console-next/docs/overview.md @@ -6,12 +6,6 @@ A verify-only component: its lane runs this suite against `web-console-next` on plan that includes it. Nothing deploys from here — a red lane blocks the convergence, which is the point. -> **This suite does not run in CI today.** The component subscribes to `dev` -> with the `quick-check` profile, which runs setup, install and a -> package-structure check — and no tests. See -> [docs/components/REVIEW.md](../../../docs/components/REVIEW.md); the fix is -> one word (`verify`) and belongs in a change that can watch what it turns on. - ## Gates - `pnpm exec turbo run build --filter=./` — build diff --git a/tests/web-console-next/package.json b/tests/web-console-next/package.json index ff3d750..7542858 100644 --- a/tests/web-console-next/package.json +++ b/tests/web-console-next/package.json @@ -30,6 +30,7 @@ "^(\\.{1,2}/.*)\\.js$": "$1", "^@saas/contracts$": "/../../packages/contracts/src/index.ts", "^@saas/contracts/(.*)$": "/../../packages/contracts/src/$1.ts", + "^@saas/sdk$": "/../../packages/sdk/src/index.ts", "^@/(.*)$": "/../../apps/web-console-next/src/$1", "^@web-console-next/(.*)$": "/../../apps/web-console-next/src/$1" }, diff --git a/tests/web-console-next/tsconfig.json b/tests/web-console-next/tsconfig.json index f19b18c..bfc59f1 100644 --- a/tests/web-console-next/tsconfig.json +++ b/tests/web-console-next/tsconfig.json @@ -11,7 +11,8 @@ "@/*": ["../../apps/web-console-next/src/*"], "@web-console-next/*": ["../../apps/web-console-next/src/*"], "@saas/contracts": ["../../packages/contracts/src/index.ts"], - "@saas/contracts/*": ["../../packages/contracts/src/*.ts"] + "@saas/contracts/*": ["../../packages/contracts/src/*.ts"], + "@saas/sdk": ["../../packages/sdk/src/index.ts"] } }, "include": [ diff --git a/tests/webhooks-worker/src/webhooks-worker.test.ts b/tests/webhooks-worker/src/webhooks-worker.test.ts index 83da1e2..94e1008 100644 --- a/tests/webhooks-worker/src/webhooks-worker.test.ts +++ b/tests/webhooks-worker/src/webhooks-worker.test.ts @@ -55,7 +55,8 @@ function createMockFetcher(responseBody: unknown, status = 200): Fetcher & { fet function createFakeEnv(overrides?: Record): Env { const base: Record = { - PLATFORM_DB: { connectionString: "postgres://fake" }, + // 127.0.0.1:1 refuses at once; a hostname here is a real DNS lookup, which a slow resolver turns into a test timeout. + PLATFORM_DB: { connectionString: "postgres://fake@127.0.0.1:1/fake" }, MEMBERSHIP_WORKER: createMockFetcher({ data: { memberships: [{ kind: "role_assignment", role: "admin", scope: { kind: "organization", orgId: TEST_ORG_UUID } }] } }), POLICY_WORKER: createMockFetcher({ data: { allow: true, reason: "org_admin", policyVersion: 1, derivedScope: { orgId: TEST_ORG_UUID } } }), ENVIRONMENT: "test",