mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ci] Add jest retry (#174389)
If a jest test is flaky, we want to retry a single step instead of re-running the entire pipeline.
This commit is contained in:
parent
b89c53b90b
commit
c3983b85a5
1 changed files with 14 additions and 8 deletions
|
@ -218,6 +218,12 @@ export async function pickTestGroupRunOrder() {
|
|||
if (Number.isNaN(FTR_CONFIGS_RETRY_COUNT)) {
|
||||
throw new Error(`invalid FTR_CONFIGS_RETRY_COUNT: ${process.env.FTR_CONFIGS_RETRY_COUNT}`);
|
||||
}
|
||||
const JEST_CONFIGS_RETRY_COUNT = process.env.JEST_CONFIGS_RETRY_COUNT
|
||||
? parseInt(process.env.JEST_CONFIGS_RETRY_COUNT, 10)
|
||||
: 1;
|
||||
if (Number.isNaN(JEST_CONFIGS_RETRY_COUNT)) {
|
||||
throw new Error(`invalid JEST_CONFIGS_RETRY_COUNT: ${process.env.JEST_CONFIGS_RETRY_COUNT}`);
|
||||
}
|
||||
|
||||
const FTR_CONFIGS_DEPS =
|
||||
process.env.FTR_CONFIGS_DEPS !== undefined
|
||||
|
@ -417,10 +423,10 @@ export async function pickTestGroupRunOrder() {
|
|||
},
|
||||
retry: {
|
||||
automatic: [
|
||||
{
|
||||
exit_status: '-1',
|
||||
limit: 3,
|
||||
},
|
||||
{ exit_status: '-1', limit: 3 },
|
||||
...(JEST_CONFIGS_RETRY_COUNT > 0
|
||||
? [{ exit_status: '*', limit: JEST_CONFIGS_RETRY_COUNT }]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@ -437,10 +443,10 @@ export async function pickTestGroupRunOrder() {
|
|||
},
|
||||
retry: {
|
||||
automatic: [
|
||||
{
|
||||
exit_status: '-1',
|
||||
limit: 3,
|
||||
},
|
||||
{ exit_status: '-1', limit: 3 },
|
||||
...(JEST_CONFIGS_RETRY_COUNT > 0
|
||||
? [{ exit_status: '*', limit: JEST_CONFIGS_RETRY_COUNT }]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue