test(gateway): 모든 프로필 DB URL 회귀를 검증한다
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
planProfileReconcile,
|
planProfileReconcile,
|
||||||
resolveResetLifecycleStatus,
|
resolveResetLifecycleStatus,
|
||||||
} from '../src/orchestrator/gatewayOrchestrator.js';
|
} from '../src/orchestrator/gatewayOrchestrator.js';
|
||||||
|
import { GATEWAY_PROFILE_ORDER } from '../src/profileOrder.js';
|
||||||
import { sanitizeManagedProcessEnv } from '../src/orchestrator/processManager.js';
|
import { sanitizeManagedProcessEnv } from '../src/orchestrator/processManager.js';
|
||||||
import type { GatewayProfileRecord } from '../src/orchestrator/profileRepository.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');
|
expect(definitions.frontend.env.VITE_APP_BASE_PATH).toBe('/che');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('passes the encoded profile database URL to every backend process', () => {
|
it.each(GATEWAY_PROFILE_ORDER)(
|
||||||
const definitions = buildProcessDefinitions(buildProfile(), {
|
'passes the encoded %s profile database URL to every backend process',
|
||||||
...processConfig,
|
(profileName) => {
|
||||||
baseEnv: {
|
const definitions = buildProcessDefinitions(
|
||||||
GATEWAY_DATABASE_URL:
|
{
|
||||||
'postgresql://sammo:encoded%23password@postgres:5432/sammo?schema=public',
|
...buildProfile(),
|
||||||
POSTGRES_USER: 'sammo',
|
profileName: `${profileName}:default`,
|
||||||
POSTGRES_PASSWORD: 'raw#password',
|
profile: profileName,
|
||||||
POSTGRES_HOST: 'postgres',
|
instanceKey: 'default',
|
||||||
POSTGRES_PORT: '5432',
|
},
|
||||||
POSTGRES_DB: 'sammo',
|
{
|
||||||
},
|
...processConfig,
|
||||||
});
|
baseEnv: {
|
||||||
const expectedUrl = 'postgresql://sammo:encoded%23password@postgres:5432/sammo?schema=che';
|
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 [
|
for (const definition of [
|
||||||
definitions.api,
|
definitions.api,
|
||||||
definitions.daemon,
|
definitions.daemon,
|
||||||
definitions.auction,
|
definitions.auction,
|
||||||
definitions.battleSim,
|
definitions.battleSim,
|
||||||
definitions.tournament,
|
definitions.tournament,
|
||||||
]) {
|
]) {
|
||||||
expect(definition.env.DATABASE_URL).toBe(expectedUrl);
|
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', () => {
|
it('applies a dedicated Node heap option only to the turn daemon', () => {
|
||||||
const definitions = buildProcessDefinitions(buildProfile(), {
|
const definitions = buildProcessDefinitions(buildProfile(), {
|
||||||
|
|||||||
Reference in New Issue
Block a user