From ca801cf927be5fec0272819da54147037957128c Mon Sep 17 00:00:00 2001 From: William Phetsinorath Date: Tue, 20 Oct 2026 17:20:06 +0200 Subject: [PATCH] test(server-nestjs): stub every required env of the plugin module spec The spec stubbed 19 env vars but not DB_URL, nor the keycloak and observability variables required by their unconditionally enabled modules, so it only passed where a local .env provided them. Stub the full required set so the test passes without a .env. Refs #2882 Co-authored-by: Automata Signed-off-by: William Phetsinorath Change-Id: I829cedfe41997cb5297d5e651efc2eb96a6a6964 --- .../src/modules/plugin/plugin.module.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/server-nestjs/src/modules/plugin/plugin.module.spec.ts b/apps/server-nestjs/src/modules/plugin/plugin.module.spec.ts index 658e110dae..cb6e009682 100644 --- a/apps/server-nestjs/src/modules/plugin/plugin.module.spec.ts +++ b/apps/server-nestjs/src/modules/plugin/plugin.module.spec.ts @@ -26,6 +26,16 @@ describe('pluginModule', () => { vi.stubEnv('SONARQUBE_URL', 'https://sonar.test/') vi.stubEnv('SONAR_API_TOKEN', 'token') vi.stubEnv('PROJECTS_ROOT_DIR', '/') + vi.stubEnv('DB_URL', 'postgres://user:pw@localhost:5432/db') + vi.stubEnv('KEYCLOAK_DOMAIN', 'keycloak.test') + vi.stubEnv('KEYCLOAK_REALM', 'console') + vi.stubEnv('KEYCLOAK_CLIENT_ID', 'console') + vi.stubEnv('KEYCLOAK_CLIENT_SECRET', 'secret') + vi.stubEnv('KEYCLOAK_ADMIN', 'admin') + vi.stubEnv('KEYCLOAK_ADMIN_PASSWORD', 'pw') + vi.stubEnv('KEYCLOAK_REDIRECT_URI', 'https://console.test/redirect') + vi.stubEnv('GRAFANA_URL', 'https://grafana.test/') + vi.stubEnv('DSO_OBSERVABILITY_CHART_VERSION', '1.0.0') vi.stubEnv('ARGOCD_URL', 'https://argocd.test/') const module = await Test.createTestingModule({ imports: [