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,9 +128,6 @@ async function main() { ...@@ -128,9 +128,6 @@ async function main() {
} }
} }
for (let i = 0; i < attempts; i++) {
console.log(`\n\nRun ${i + 1}/${attempts} for ${testMode} tests (Webpack)`)
// We apply the external tests filter before the process.env so that if // We apply the external tests filter before the process.env so that if
// it's defined in the environment, it overrides the default filter. // it's defined in the environment, it overrides the default filter.
// This is required for supporting the experimental tests setup. // This is required for supporting the experimental tests setup.
...@@ -146,32 +143,35 @@ async function main() { ...@@ -146,32 +143,35 @@ async function main() {
) )
} }
if (isFlakeDetectionMode && testMode !== 'deploy') {
for (let i = 0; i < attempts; i++) {
console.log(
`\n\nRun ${i + 1}/${attempts} for ${testMode} tests (Turbopack)`
)
await execa('node', [...RUN_TESTS_ARGS, ...currentTests], { await execa('node', [...RUN_TESTS_ARGS, ...currentTests], {
...EXECA_OPTS_STDIO, ...EXECA_OPTS_STDIO,
env: { env: {
...process.env, ...process.env,
NEXT_EXTERNAL_TESTS_FILTERS,
NEXT_TEST_MODE: testMode, NEXT_TEST_MODE: testMode,
NEXT_TEST_VERSION: nextTestVersion, NEXT_TEST_VERSION: nextTestVersion,
IS_WEBPACK_TEST: '1', IS_TURBOPACK_TEST: '1',
TURBOPACK_BUILD: testMode === 'start' ? '1' : undefined,
TURBOPACK_DEV: testMode === 'dev' ? '1' : undefined,
}, },
}) })
} }
} else {
if (isFlakeDetectionMode && testMode !== 'deploy') {
for (let i = 0; i < attempts; i++) { for (let i = 0; i < attempts; i++) {
console.log( console.log(`\n\nRun ${i + 1}/${attempts} for ${testMode} tests`)
`\n\nRun ${i + 1}/${attempts} for ${testMode} tests (Turbopack)`
)
await execa('node', [...RUN_TESTS_ARGS, ...currentTests], { await execa('node', [...RUN_TESTS_ARGS, ...currentTests], {
...EXECA_OPTS_STDIO, ...EXECA_OPTS_STDIO,
env: { env: {
...process.env, ...process.env,
NEXT_EXTERNAL_TESTS_FILTERS,
NEXT_TEST_MODE: testMode, NEXT_TEST_MODE: testMode,
NEXT_TEST_VERSION: nextTestVersion, NEXT_TEST_VERSION: nextTestVersion,
IS_TURBOPACK_TEST: '1', IS_WEBPACK_TEST: '1',
TURBOPACK_BUILD: testMode === 'start' ? '1' : undefined,
TURBOPACK_DEV: testMode === 'dev' ? '1' : undefined,
}, },
}) })
} }
......
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