fix(gateway): 프로필 런타임 DB URL을 고정한다
game API와 daemon, worker PM2 정의에 인코딩된 profile DATABASE_URL을 명시한다. migration 성공 뒤 runtime과 rollback이 raw POSTGRES 비밀번호로 실패하는 경로를 회귀 테스트한다.
This commit is contained in:
@@ -250,7 +250,6 @@ describe('buildProcessDefinitions', () => {
|
||||
});
|
||||
|
||||
for (const definition of Object.values(definitions)) {
|
||||
expect(definition.env).toMatchObject({ DATABASE_URL: 'postgresql://integration.invalid/sammo' });
|
||||
expect(definition.env).not.toHaveProperty('pm_id');
|
||||
expect(definition.env).not.toHaveProperty('args');
|
||||
expect(definition.env).not.toHaveProperty('pm_exec_path');
|
||||
@@ -258,9 +257,46 @@ describe('buildProcessDefinitions', () => {
|
||||
expect(definition.env).not.toHaveProperty('NODE_APP_INSTANCE');
|
||||
expect(definition.env).not.toHaveProperty('GATEWAY_ROLE');
|
||||
}
|
||||
expect(definitions.frontend.env.DATABASE_URL).toBe('postgresql://integration.invalid/sammo');
|
||||
for (const definition of [
|
||||
definitions.api,
|
||||
definitions.daemon,
|
||||
definitions.auction,
|
||||
definitions.battleSim,
|
||||
definitions.tournament,
|
||||
]) {
|
||||
expect(definition.env.DATABASE_URL).toBe('postgresql://integration.invalid/sammo?schema=che');
|
||||
}
|
||||
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';
|
||||
|
||||
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');
|
||||
});
|
||||
|
||||
it('applies a dedicated Node heap option only to the turn daemon', () => {
|
||||
const definitions = buildProcessDefinitions(buildProfile(), {
|
||||
...processConfig,
|
||||
|
||||
Reference in New Issue
Block a user