Unverified Commit b394d533 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

[ci]: update flake detection to only run in Turbopack (#84659)

Flake detection runs changed test(s) 6 times: 3 in Webpack, 3 in
Turbopack. for the purposes of detecting flakes, and to reduce the
burden on CI, this runs flake detection only with Turbopack (esp. now
that it's enabled by default).
parent 35f60806
...@@ -128,34 +128,19 @@ async function main() { ...@@ -128,34 +128,19 @@ async function main() {
} }
} }
for (let i = 0; i < attempts; i++) { // We apply the external tests filter before the process.env so that if
console.log(`\n\nRun ${i + 1}/${attempts} for ${testMode} tests (Webpack)`) // it's defined in the environment, it overrides the default filter.
// This is required for supporting the experimental tests setup.
// We apply the external tests filter before the process.env so that if const NEXT_EXTERNAL_TESTS_FILTERS = process.env.NEXT_EXTERNAL_TESTS_FILTERS
// it's defined in the environment, it overrides the default filter. ? process.env.NEXT_EXTERNAL_TESTS_FILTERS
// This is required for supporting the experimental tests setup. : testMode === 'deploy'
const NEXT_EXTERNAL_TESTS_FILTERS = process.env.NEXT_EXTERNAL_TESTS_FILTERS ? 'test/deploy-tests-manifest.json'
? process.env.NEXT_EXTERNAL_TESTS_FILTERS : undefined
: testMode === 'deploy'
? 'test/deploy-tests-manifest.json'
: undefined
if (NEXT_EXTERNAL_TESTS_FILTERS) {
console.log(
`Applying external tests filter: ${NEXT_EXTERNAL_TESTS_FILTERS}`
)
}
await execa('node', [...RUN_TESTS_ARGS, ...currentTests], { if (NEXT_EXTERNAL_TESTS_FILTERS) {
...EXECA_OPTS_STDIO, console.log(
env: { `Applying external tests filter: ${NEXT_EXTERNAL_TESTS_FILTERS}`
...process.env, )
NEXT_EXTERNAL_TESTS_FILTERS,
NEXT_TEST_MODE: testMode,
NEXT_TEST_VERSION: nextTestVersion,
IS_WEBPACK_TEST: '1',
},
})
} }
if (isFlakeDetectionMode && testMode !== 'deploy') { if (isFlakeDetectionMode && testMode !== 'deploy') {
...@@ -175,6 +160,21 @@ async function main() { ...@@ -175,6 +160,21 @@ async function main() {
}, },
}) })
} }
} else {
for (let i = 0; i < attempts; i++) {
console.log(`\n\nRun ${i + 1}/${attempts} for ${testMode} tests`)
await execa('node', [...RUN_TESTS_ARGS, ...currentTests], {
...EXECA_OPTS_STDIO,
env: {
...process.env,
NEXT_EXTERNAL_TESTS_FILTERS,
NEXT_TEST_MODE: testMode,
NEXT_TEST_VERSION: nextTestVersion,
IS_WEBPACK_TEST: '1',
},
})
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment