Files
core2026/app/gateway-api/test/profileRepository.test.ts
T
Hide_D 4977fb615d fix: 일반 리셋이 서버 지정 브랜치를 추적
상위 배포 권한자가 선택한 branch 또는 commit 정책을 profile metadata에 보존하고 일반 시나리오 초기화가 이를 따르도록 변경한다. 같은 active commit의 설치 완료 workspace는 빌드를 생략하고 기존 migration, seed, readiness 흐름을 유지한다.
2026-08-19 13:42:52 +00:00

57 lines
2.0 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildRetryOperationPayload, buildRetryOperationSource } from '../src/orchestrator/profileRepository.js';
describe('buildRetryOperationPayload', () => {
it('pins the first failed operation as the install generation', () => {
expect(
buildRetryOperationPayload({ install: { scenarioId: 1010 } }, '11111111-1111-4111-8111-111111111111')
).toEqual({
install: { scenarioId: 1010 },
installOperationId: '11111111-1111-4111-8111-111111111111',
});
});
it('preserves the original install generation across chained retries', () => {
expect(
buildRetryOperationPayload(
{
install: { scenarioId: 903 },
installOperationId: 'original-install-generation',
releaseSource: { mode: 'BRANCH', ref: 'main' },
},
'newer-failed-operation'
)
).toEqual({
install: { scenarioId: 903 },
installOperationId: 'original-install-generation',
releaseSource: { mode: 'BRANCH', ref: 'main' },
});
});
});
describe('buildRetryOperationSource', () => {
it('pins a resolved branch operation to the original commit', () => {
expect(
buildRetryOperationSource({
sourceMode: 'BRANCH',
sourceRef: 'main',
resolvedCommitSha: 'abcdef0123456789abcdef0123456789abcdef01',
})
).toEqual({
sourceMode: 'COMMIT',
sourceRef: 'abcdef0123456789abcdef0123456789abcdef01',
});
});
it('keeps the requested source when resolution never completed', () => {
expect(
buildRetryOperationSource({
sourceMode: 'BRANCH',
sourceRef: 'main',
resolvedCommitSha: null,
})
).toEqual({ sourceMode: 'BRANCH', sourceRef: 'main' });
});
});