feat: 限制发布单重试边界
This commit is contained in:
@@ -382,7 +382,13 @@ describe('DeployRunsService', () => {
|
||||
});
|
||||
|
||||
it('retries a deploy run with retry trigger', async () => {
|
||||
const { repository, service } = createService();
|
||||
const failedRun: DeployRunSummary = {
|
||||
...baseRun,
|
||||
status: 'failed',
|
||||
};
|
||||
const { repository, service } = createService({
|
||||
runs: [failedRun],
|
||||
});
|
||||
|
||||
const run = await service.retryRun(baseRun.id);
|
||||
|
||||
@@ -396,6 +402,15 @@ describe('DeployRunsService', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects non-terminal retry requests before creating a new run', async () => {
|
||||
const { repository, service } = createService();
|
||||
|
||||
await expect(service.retryRun(baseRun.id)).rejects.toBeInstanceOf(
|
||||
AppError,
|
||||
);
|
||||
expect(repository.create).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('syncs all queued or running Jenkins runs with queue/build identifiers', async () => {
|
||||
const queuedRun: DeployRunSummary = {
|
||||
...baseRun,
|
||||
|
||||
Reference in New Issue
Block a user