From ecc8721238c9f9db0566b3d0c3db74a52e19e04f Mon Sep 17 00:00:00 2001 From: hided62 Date: Sat, 22 Aug 2026 16:55:03 +0000 Subject: [PATCH] =?UTF-8?q?test(gateway):=20=EB=AA=A8=EB=93=A0=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20DB=20URL=20=ED=9A=8C=EA=B7=80=EB=A5=BC=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gateway-api/test/orchestratorPlan.test.ts | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/app/gateway-api/test/orchestratorPlan.test.ts b/app/gateway-api/test/orchestratorPlan.test.ts index 7026238e..376fefc7 100644 --- a/app/gateway-api/test/orchestratorPlan.test.ts +++ b/app/gateway-api/test/orchestratorPlan.test.ts @@ -10,6 +10,7 @@ import { planProfileReconcile, resolveResetLifecycleStatus, } from '../src/orchestrator/gatewayOrchestrator.js'; +import { GATEWAY_PROFILE_ORDER } from '../src/profileOrder.js'; import { sanitizeManagedProcessEnv } from '../src/orchestrator/processManager.js'; import type { GatewayProfileRecord } from '../src/orchestrator/profileRepository.js'; @@ -270,32 +271,42 @@ describe('buildProcessDefinitions', () => { expect(definitions.frontend.env.VITE_APP_BASE_PATH).toBe('/che'); }); - it('passes the encoded profile database URL to every backend process', () => { - const definitions = buildProcessDefinitions(buildProfile(), { - ...processConfig, - baseEnv: { - GATEWAY_DATABASE_URL: - 'postgresql://sammo:encoded%23password@postgres:5432/sammo?schema=public', - POSTGRES_USER: 'sammo', - POSTGRES_PASSWORD: 'raw#password', - POSTGRES_HOST: 'postgres', - POSTGRES_PORT: '5432', - POSTGRES_DB: 'sammo', - }, - }); - const expectedUrl = 'postgresql://sammo:encoded%23password@postgres:5432/sammo?schema=che'; + it.each(GATEWAY_PROFILE_ORDER)( + 'passes the encoded %s profile database URL to every backend process', + (profileName) => { + const definitions = buildProcessDefinitions( + { + ...buildProfile(), + profileName: `${profileName}:default`, + profile: profileName, + instanceKey: 'default', + }, + { + ...processConfig, + baseEnv: { + GATEWAY_DATABASE_URL: 'postgresql://sammo:encoded%23password@postgres:5432/sammo?schema=public', + POSTGRES_USER: 'sammo', + POSTGRES_PASSWORD: 'raw#password', + POSTGRES_HOST: 'postgres', + POSTGRES_PORT: '5432', + POSTGRES_DB: 'sammo', + }, + } + ); + const expectedUrl = `postgresql://sammo:encoded%23password@postgres:5432/sammo?schema=${profileName}`; - for (const definition of [ - definitions.api, - definitions.daemon, - definitions.auction, - definitions.battleSim, - definitions.tournament, - ]) { - expect(definition.env.DATABASE_URL).toBe(expectedUrl); + for (const definition of [ + definitions.api, + definitions.daemon, + definitions.auction, + definitions.battleSim, + definitions.tournament, + ]) { + expect(definition.env.DATABASE_URL).toBe(expectedUrl); + } + expect(definitions.frontend.env).not.toHaveProperty('DATABASE_URL'); } - expect(definitions.frontend.env).not.toHaveProperty('DATABASE_URL'); - }); + ); it('applies a dedicated Node heap option only to the turn daemon', () => { const definitions = buildProcessDefinitions(buildProfile(), {