FED-M1-07 — Adds three integration tests that exercise the federated tier against a live docker-compose federated profile. Real services, no mocks.
Tests
File
Assertion
federated-boot.success.integration.test.ts
detectAndAssertTier resolves; pg_extension row for vector exists
federated-boot.pg-unreachable.integration.test.ts
Throws TierDetectionError with service: 'postgres' when PG port is closed
federated-pgvector.integration.test.ts
TEMP table with vector(3) column round-trips [1,2,3]
Skip gating
All three tests are gated behind process.env.FEDERATED_INTEGRATION === '1' using describe.skipIf(!run). Running pnpm test without the env var skips them cleanly (4 tests, all skipped, exit 0). CI prologue is responsible for compose lifecycle — tests do not manage docker.
Closed-port reservation
Test B uses net.createServer().listen(0) to reserve an ephemeral port and immediately release it, then targets that port. This avoids host-port collisions with other Postgres clusters that an arbitrary "5499" assumption would have risked (caught by independent code review).
Code review feedback addressed
Independent sonnet review (VERDICT: B) flagged two IMPORTANT items, both fixed in this PR:
Port 5499 collision risk → reserved-port helper above
afterAll and sql scoped outside describe → moved both inside describe.skipIf block; cleanup only runs when describe activates
Verification
$ docker compose -f docker-compose.federated.yml --profile federated up -d
$ FEDERATED_INTEGRATION=1 pnpm --filter @mosaicstack/gateway test src/__tests__/integration/
Test Files 3 passed (3)
Tests 4 passed (4)
$ pnpm --filter @mosaicstack/gateway test src/__tests__/integration/ # no env var
Tests 4 skipped (4)
Independent surface verification (haiku) confirmed file paths, imports, skip pattern, no new dependencies, lint + typecheck pass.
Test plan
CI green (typecheck + lint + format gates pass; integration tests skip without env var)
Manual smoke: spin up federated compose stack and rerun with FEDERATED_INTEGRATION=1
## Summary
FED-M1-07 — Adds three integration tests that exercise the federated tier against a live docker-compose `federated` profile. Real services, no mocks.
## Tests
| File | Assertion |
| --- | --- |
| `federated-boot.success.integration.test.ts` | `detectAndAssertTier` resolves; `pg_extension` row for `vector` exists |
| `federated-boot.pg-unreachable.integration.test.ts` | Throws `TierDetectionError` with `service: 'postgres'` when PG port is closed |
| `federated-pgvector.integration.test.ts` | TEMP table with `vector(3)` column round-trips `[1,2,3]` |
## Skip gating
All three tests are gated behind `process.env.FEDERATED_INTEGRATION === '1'` using `describe.skipIf(!run)`. Running `pnpm test` without the env var skips them cleanly (4 tests, all skipped, exit 0). CI prologue is responsible for compose lifecycle — tests do not manage docker.
## Closed-port reservation
Test B uses `net.createServer().listen(0)` to reserve an ephemeral port and immediately release it, then targets that port. This avoids host-port collisions with other Postgres clusters that an arbitrary "5499" assumption would have risked (caught by independent code review).
## Code review feedback addressed
Independent sonnet review (VERDICT: B) flagged two IMPORTANT items, both fixed in this PR:
1. **Port 5499 collision risk** → reserved-port helper above
2. **`afterAll` and `sql` scoped outside `describe`** → moved both inside `describe.skipIf` block; cleanup only runs when describe activates
## Verification
```
$ docker compose -f docker-compose.federated.yml --profile federated up -d
$ FEDERATED_INTEGRATION=1 pnpm --filter @mosaicstack/gateway test src/__tests__/integration/
Test Files 3 passed (3)
Tests 4 passed (4)
$ pnpm --filter @mosaicstack/gateway test src/__tests__/integration/ # no env var
Tests 4 skipped (4)
```
Independent surface verification (haiku) confirmed file paths, imports, skip pattern, no new dependencies, lint + typecheck pass.
## Test plan
- [ ] CI green (typecheck + lint + format gates pass; integration tests skip without env var)
- [ ] Manual smoke: spin up federated compose stack and rerun with `FEDERATED_INTEGRATION=1`
Refs #460
Adds three integration tests gated by FEDERATED_INTEGRATION=1 that exercise
the federated tier against a live docker-compose federated profile:
- federated-boot.success — detectAndAssertTier resolves; pg_extension lists vector
- federated-boot.pg-unreachable — fail-fast TierDetectionError(service=postgres)
using OS-reserved closed port to avoid host-port collisions
- federated-pgvector — TEMP table with vector(3) column round-trips data
Real services, no mocks. Tests skip cleanly when env var is unset.
Refs #460
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
FED-M1-07 — Adds three integration tests that exercise the federated tier against a live docker-compose
federatedprofile. Real services, no mocks.Tests
federated-boot.success.integration.test.tsdetectAndAssertTierresolves;pg_extensionrow forvectorexistsfederated-boot.pg-unreachable.integration.test.tsTierDetectionErrorwithservice: 'postgres'when PG port is closedfederated-pgvector.integration.test.tsvector(3)column round-trips[1,2,3]Skip gating
All three tests are gated behind
process.env.FEDERATED_INTEGRATION === '1'usingdescribe.skipIf(!run). Runningpnpm testwithout the env var skips them cleanly (4 tests, all skipped, exit 0). CI prologue is responsible for compose lifecycle — tests do not manage docker.Closed-port reservation
Test B uses
net.createServer().listen(0)to reserve an ephemeral port and immediately release it, then targets that port. This avoids host-port collisions with other Postgres clusters that an arbitrary "5499" assumption would have risked (caught by independent code review).Code review feedback addressed
Independent sonnet review (VERDICT: B) flagged two IMPORTANT items, both fixed in this PR:
afterAllandsqlscoped outsidedescribe→ moved both insidedescribe.skipIfblock; cleanup only runs when describe activatesVerification
Independent surface verification (haiku) confirmed file paths, imports, skip pattern, no new dependencies, lint + typecheck pass.
Test plan
FEDERATED_INTEGRATION=1Refs #460