From 5ea040af4c28614195151a88cf43ffc458706652 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Wed, 22 Apr 2026 00:28:46 -0500 Subject: [PATCH] test(federation): require all Step-CA env vars for stepCaRun gate Guard against partial env var sets where STEP_CA_AVAILABLE=1 is set but provisioner key or root cert path are missing, which would cause CaService constructor to throw during NestJS module instantiation. Co-Authored-By: Claude Sonnet 4.6 --- .../integration/federation-m2-e2e.integration.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/gateway/src/__tests__/integration/federation-m2-e2e.integration.test.ts b/apps/gateway/src/__tests__/integration/federation-m2-e2e.integration.test.ts index a2234bf..df77af9 100644 --- a/apps/gateway/src/__tests__/integration/federation-m2-e2e.integration.test.ts +++ b/apps/gateway/src/__tests__/integration/federation-m2-e2e.integration.test.ts @@ -54,7 +54,12 @@ import { GrantsService } from '../../federation/grants.service.js'; import { EnrollmentService } from '../../federation/enrollment.service.js'; const run = process.env['FEDERATED_INTEGRATION'] === '1'; -const stepCaRun = run && process.env['STEP_CA_AVAILABLE'] === '1'; +const stepCaRun = + run && + process.env['STEP_CA_AVAILABLE'] === '1' && + !!process.env['STEP_CA_URL'] && + !!process.env['STEP_CA_PROVISIONER_KEY_JSON'] && + !!process.env['STEP_CA_ROOT_CERT_PATH']; const PG_URL = 'postgresql://mosaic:mosaic@localhost:5433/mosaic';