Skip to content

Commit 5e3258c

Browse files
fix: test retries
1 parent d56c8b9 commit 5e3258c

13 files changed

+89
-89
lines changed

.github/workflows/common-test.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ jobs:
7373
run: npm run deploy
7474
working-directory: test/cdk-basic
7575
- name: Test
76-
run: npx vitest --retry 2 test/cdk-basic.test.ts
76+
run: npx vitest --retry 0 test/cdk-basic.test.ts
7777
- name: Test - observability mode
78-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/cdk-basic.test.ts
78+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/cdk-basic.test.ts
7979
- name: Deploy YAML version
8080
run: npm run deploy-yaml
8181
working-directory: test/cdk-basic
8282
- name: Test YAML
83-
run: npx vitest --retry 2 test/cdk-basic.test.ts
83+
run: npx vitest --retry 0 test/cdk-basic.test.ts
8484

8585
test-cdk-esm:
8686
runs-on: ubuntu-latest
@@ -127,9 +127,9 @@ jobs:
127127
run: npm run deploy
128128
working-directory: test/cdk-esm
129129
- name: Test
130-
run: npx vitest --retry 2 test/cdk-esm.test.ts
130+
run: npx vitest --retry 0 test/cdk-esm.test.ts
131131
- name: Test - observability mode
132-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/cdk-esm.test.ts
132+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/cdk-esm.test.ts
133133

134134
test-sls-basic:
135135
runs-on: ubuntu-latest
@@ -177,9 +177,9 @@ jobs:
177177
run: npm run deploy
178178
working-directory: test/sls-basic
179179
- name: Test
180-
run: npx vitest --retry 2 test/sls-basic.test.ts
180+
run: npx vitest --retry 0 test/sls-basic.test.ts
181181
- name: Test - observability mode
182-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sls-basic.test.ts
182+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/sls-basic.test.ts
183183

184184
test-sls-esbuild-cjs:
185185
runs-on: ubuntu-latest
@@ -227,9 +227,9 @@ jobs:
227227
run: npm run deploy
228228
working-directory: test/sls-esbuild-cjs
229229
- name: Test
230-
run: npx vitest --retry 2 test/sls-esbuild-cjs.test.ts
230+
run: npx vitest --retry 0 test/sls-esbuild-cjs.test.ts
231231
- name: Test - observability mode
232-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sls-esbuild-cjs.test.ts
232+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/sls-esbuild-cjs.test.ts
233233

234234
test-sls-esbuild-esm:
235235
runs-on: ubuntu-latest
@@ -277,9 +277,9 @@ jobs:
277277
run: npm run deploy
278278
working-directory: test/sls-esbuild-esm
279279
- name: Test
280-
run: npx vitest --retry 2 test/sls-esbuild-esm.test.ts
280+
run: npx vitest --retry 0 test/sls-esbuild-esm.test.ts
281281
- name: Test - observability mode
282-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sls-esbuild-esm.test.ts
282+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/sls-esbuild-esm.test.ts
283283

284284
test-osls-basic:
285285
runs-on: ubuntu-latest
@@ -327,9 +327,9 @@ jobs:
327327
run: npm run deploy
328328
working-directory: test/osls-basic
329329
- name: Test
330-
run: npx vitest --retry 2 test/osls-basic.test.ts
330+
run: npx vitest --retry 0 test/osls-basic.test.ts
331331
- name: Test - observability mode
332-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/osls-basic.test.ts
332+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/osls-basic.test.ts
333333

334334
test-osls-esbuild-cjs:
335335
runs-on: ubuntu-latest
@@ -377,9 +377,9 @@ jobs:
377377
run: npm run deploy
378378
working-directory: test/osls-esbuild-cjs
379379
- name: Test
380-
run: npx vitest --retry 2 test/osls-esbuild-cjs.test.ts
380+
run: npx vitest --retry 0 test/osls-esbuild-cjs.test.ts
381381
- name: Test - observability mode
382-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/osls-esbuild-cjs.test.ts
382+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/osls-esbuild-cjs.test.ts
383383

384384
test-osls-esbuild-esm:
385385
runs-on: ubuntu-latest
@@ -427,9 +427,9 @@ jobs:
427427
run: npm run deploy
428428
working-directory: test/osls-esbuild-esm
429429
- name: Test
430-
run: npx vitest --retry 2 test/osls-esbuild-esm.test.ts
430+
run: npx vitest --retry 0 test/osls-esbuild-esm.test.ts
431431
- name: Test - observability mode
432-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/osls-esbuild-esm.test.ts
432+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/osls-esbuild-esm.test.ts
433433

434434
test-sam-basic:
435435
runs-on: ubuntu-latest
@@ -480,9 +480,9 @@ jobs:
480480
run: npm run deploy
481481
working-directory: test/sam-basic
482482
- name: Test
483-
run: npx vitest --retry 2 test/sam-basic.test.ts
483+
run: npx vitest --retry 0 test/sam-basic.test.ts
484484
- name: Test - observability mode
485-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sam-basic.test.ts
485+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/sam-basic.test.ts
486486

487487
test-sam-alt:
488488
runs-on: ubuntu-latest
@@ -533,9 +533,9 @@ jobs:
533533
run: npm run deploy
534534
working-directory: test/sam-alt
535535
- name: Test
536-
run: npx vitest --retry 2 test/sam-alt.test.ts
536+
run: npx vitest --retry 0 test/sam-alt.test.ts
537537
- name: Test - observability mode
538-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sam-alt.test.ts
538+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/sam-alt.test.ts
539539

540540
test-terraform-basic:
541541
runs-on: ubuntu-latest
@@ -589,9 +589,9 @@ jobs:
589589
run: npm run deploy
590590
working-directory: test/terraform-basic
591591
- name: Test
592-
run: npx vitest --retry 2 test/terraform-basic.test.ts
592+
run: npx vitest --retry 0 test/terraform-basic.test.ts
593593
- name: Test - observability mode
594-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/terraform-basic.test.ts
594+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/terraform-basic.test.ts
595595

596596
test-opentofu-basic:
597597
runs-on: ubuntu-latest
@@ -645,6 +645,6 @@ jobs:
645645
run: npm run deploy
646646
working-directory: test/opentofu-basic
647647
- name: Test
648-
run: npx vitest --retry 2 test/opentofu-basic.test.ts
648+
run: npx vitest --retry 0 test/opentofu-basic.test.ts
649649
- name: Test - observability mode
650-
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/opentofu-basic.test.ts
650+
run: OBSERVABLE_MODE=true npx vitest --retry 0 test/opentofu-basic.test.ts

test/cdk-basic.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ describe('cdk-basic', async () => {
3333
lldProcess?.kill();
3434
});
3535

36-
test('check infra', async () => {
36+
test('check infra', { retry: 3 }, async () => {
3737
const lambdaName = await getFunctionName(
3838
folder,
3939
'FunctionNameTestTsCommonJs',
4040
);
4141
await expectInfraDeployed(lambdaName);
4242
});
4343

44-
test('call Lambda - testTsCommonJs', async () => {
44+
test('call Lambda - testTsCommonJs', { retry: 3 }, async () => {
4545
const lambdaName = await getFunctionName(
4646
folder,
4747
'FunctionNameTestTsCommonJs',
@@ -57,7 +57,7 @@ describe('cdk-basic', async () => {
5757
}
5858
});
5959

60-
test('call Lambda - testTsEsModule', async () => {
60+
test('call Lambda - testTsEsModule', { retry: 3 }, async () => {
6161
const lambdaName = await getFunctionName(
6262
folder,
6363
'FunctionNameTestTsEsModule',
@@ -73,7 +73,7 @@ describe('cdk-basic', async () => {
7373
}
7474
});
7575

76-
test('call Lambda - testJsCommonJs', async () => {
76+
test('call Lambda - testJsCommonJs', { retry: 3 }, async () => {
7777
const lambdaName = await getFunctionName(
7878
folder,
7979
'FunctionNameTestJsCommonJs',
@@ -89,7 +89,7 @@ describe('cdk-basic', async () => {
8989
}
9090
});
9191

92-
test('call Lambda - testJsEsModule', async () => {
92+
test('call Lambda - testJsEsModule', { retry: 3 }, async () => {
9393
const lambdaName = await getFunctionName(
9494
folder,
9595
'FunctionNameTestJsEsModule',
@@ -105,7 +105,7 @@ describe('cdk-basic', async () => {
105105
}
106106
});
107107

108-
test('call Lambda - testJsCommonJsBase', async () => {
108+
test('call Lambda - testJsCommonJsBase', { retry: 3 }, async () => {
109109
const lambdaName = await getFunctionName(
110110
folder,
111111
'FunctionNameTestJsCommonJsBase',
@@ -121,7 +121,7 @@ describe('cdk-basic', async () => {
121121
}
122122
});
123123

124-
test('call Lambda - testJsEsModuleBase', async () => {
124+
test('call Lambda - testJsEsModuleBase', { retry: 3 }, async () => {
125125
const lambdaName = await getFunctionName(
126126
folder,
127127
'FunctionNameTestJsEsModuleBase',
@@ -137,7 +137,7 @@ describe('cdk-basic', async () => {
137137
}
138138
});
139139

140-
test('remove infra', async () => {
140+
test('remove infra', { retry: 3 }, async () => {
141141
if (process.env.CI === 'true' || process.env.RUN_TEST_FROM_CLI === 'true') {
142142
await removeInfra(lldProcess, folder, ['-c environment=test']);
143143
const lambdaName = await getFunctionName(

test/cdk-esm.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ describe('cdk-esm', async () => {
3333
lldProcess?.kill();
3434
});
3535

36-
test('check infra', async () => {
36+
test('check infra', { retry: 3 }, async () => {
3737
const lambdaName = await getFunctionName(
3838
folder,
3939
'FunctionNameTestTsCommonJs',
4040
);
4141
await expectInfraDeployed(lambdaName);
4242
});
4343

44-
test('call Lambda - testTsCommonJs', async () => {
44+
test('call Lambda - testTsCommonJs', { retry: 3 }, async () => {
4545
const lambdaName = await getFunctionName(
4646
folder,
4747
'FunctionNameTestTsCommonJs',
@@ -57,7 +57,7 @@ describe('cdk-esm', async () => {
5757
}
5858
});
5959

60-
test('call Lambda - testTsEsModule', async () => {
60+
test('call Lambda - testTsEsModule', { retry: 3 }, async () => {
6161
const lambdaName = await getFunctionName(
6262
folder,
6363
'FunctionNameTestTsEsModule',
@@ -73,7 +73,7 @@ describe('cdk-esm', async () => {
7373
}
7474
});
7575

76-
test('call Lambda - testJsCommonJs', async () => {
76+
test('call Lambda - testJsCommonJs', { retry: 3 }, async () => {
7777
const lambdaName = await getFunctionName(
7878
folder,
7979
'FunctionNameTestJsCommonJs',
@@ -89,7 +89,7 @@ describe('cdk-esm', async () => {
8989
}
9090
});
9191

92-
test('call Lambda - testJsEsModule', async () => {
92+
test('call Lambda - testJsEsModule', { retry: 3 }, async () => {
9393
const lambdaName = await getFunctionName(
9494
folder,
9595
'FunctionNameTestJsEsModule',
@@ -105,7 +105,7 @@ describe('cdk-esm', async () => {
105105
}
106106
});
107107

108-
test('call Lambda - testJsCommonJsBase', async () => {
108+
test('call Lambda - testJsCommonJsBase', { retry: 3 }, async () => {
109109
const lambdaName = await getFunctionName(
110110
folder,
111111
'FunctionNameTestJsCommonJsBase',
@@ -121,7 +121,7 @@ describe('cdk-esm', async () => {
121121
}
122122
});
123123

124-
test('call Lambda - testJsEsModuleBase', async () => {
124+
test('call Lambda - testJsEsModuleBase', { retry: 3 }, async () => {
125125
const lambdaName = await getFunctionName(
126126
folder,
127127
'FunctionNameTestJsEsModuleBase',
@@ -137,7 +137,7 @@ describe('cdk-esm', async () => {
137137
}
138138
});
139139

140-
test('remove infra', async () => {
140+
test('remove infra', { retry: 3 }, async () => {
141141
if (process.env.CI === 'true' || process.env.RUN_TEST_FROM_CLI === 'true') {
142142
await removeInfra(lldProcess, folder, ['-c environment=test']);
143143
const lambdaName = await getFunctionName(

test/opentofu-basic.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ describe('opentofu-basic', async () => {
3737
lldProcess?.kill();
3838
});
3939

40-
test('check infra', async () => {
40+
test('check infra', { retry: 3 }, async () => {
4141
const lambdaName = await getFunctionName(
4242
folder,
4343
'lambda-test-js-commonjs_1_name',
4444
);
4545
await expectInfraDeployed(lambdaName);
4646
});
4747

48-
test('call Lambda - testTsCommonJs', async () => {
48+
test('call Lambda - testTsCommonJs', { retry: 3 }, async () => {
4949
const lambdaName = await getFunctionName(
5050
folder,
5151
'lambda-test-ts-commonjs_name',
@@ -61,7 +61,7 @@ describe('opentofu-basic', async () => {
6161
}
6262
});
6363

64-
test('call Lambda - testTsEsModule', async () => {
64+
test('call Lambda - testTsEsModule', { retry: 3 }, async () => {
6565
const lambdaName = await getFunctionName(
6666
folder,
6767
'lambda-test-ts-esmodule_name',
@@ -77,7 +77,7 @@ describe('opentofu-basic', async () => {
7777
}
7878
});
7979

80-
test('call Lambda - testJsCommonJs_1', async () => {
80+
test('call Lambda - testJsCommonJs_1', { retry: 3 }, async () => {
8181
const lambdaName = await getFunctionName(
8282
folder,
8383
'lambda-test-js-commonjs_1_name',
@@ -93,7 +93,7 @@ describe('opentofu-basic', async () => {
9393
}
9494
});
9595

96-
test('call Lambda - testJsCommonJs_2', async () => {
96+
test('call Lambda - testJsCommonJs_2', { retry: 3 }, async () => {
9797
const lambdaName = await getFunctionName(
9898
folder,
9999
'lambda-test-js-commonjs_2_name',
@@ -109,7 +109,7 @@ describe('opentofu-basic', async () => {
109109
}
110110
});
111111

112-
test('call Lambda - testJsCommonJs_3', async () => {
112+
test('call Lambda - testJsCommonJs_3', { retry: 3 }, async () => {
113113
const lambdaName = await getFunctionName(
114114
folder,
115115
'lambda-test-js-commonjs_3_name',
@@ -125,7 +125,7 @@ describe('opentofu-basic', async () => {
125125
}
126126
});
127127

128-
test('call Lambda - testJsEsModule', async () => {
128+
test('call Lambda - testJsEsModule', { retry: 3 }, async () => {
129129
const lambdaName = await getFunctionName(
130130
folder,
131131
'lambda-test-js-esmodule_name',
@@ -141,7 +141,7 @@ describe('opentofu-basic', async () => {
141141
}
142142
});
143143

144-
test('remove infra', async () => {
144+
test('remove infra', { retry: 3 }, async () => {
145145
if (process.env.CI === 'true' || process.env.RUN_TEST_FROM_CLI === 'true') {
146146
await removeInfra(lldProcess, folder, args);
147147
const lambdaName = await getFunctionName(

test/osls-basic.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ describe('osls-basic', async () => {
3030
lldProcess?.kill();
3131
});
3232

33-
test('check infra', async () => {
33+
test('check infra', { retry: 3 }, async () => {
3434
const lambdaName = 'lls-osls-basic-test-testJsCommonJs';
3535
await expectInfraDeployed(lambdaName);
3636
});
3737

38-
test('call Lambda - testJsCommonJs', async () => {
38+
test('call Lambda - testJsCommonJs', { retry: 3 }, async () => {
3939
const lambdaName = 'lls-osls-basic-test-testJsCommonJs';
4040

4141
const payload = getSamplePayload(lambdaName);
@@ -48,7 +48,7 @@ describe('osls-basic', async () => {
4848
}
4949
});
5050

51-
test('call Lambda - testJsEsModule', async () => {
51+
test('call Lambda - testJsEsModule', { retry: 3 }, async () => {
5252
const lambdaName = 'lls-osls-basic-test-testJsEsModule';
5353

5454
const payload = getSamplePayload(lambdaName);
@@ -61,7 +61,7 @@ describe('osls-basic', async () => {
6161
}
6262
});
6363

64-
test('remove infra', async () => {
64+
test('remove infra', { retry: 3 }, async () => {
6565
if (process.env.CI === 'true' || process.env.RUN_TEST_FROM_CLI === 'true') {
6666
await removeInfra(lldProcess, folder, ['--stage=test']);
6767
const lambdaName = 'lls-osls-basic-test-testJsCommonJs';

0 commit comments

Comments
 (0)