Skip to content

Commit b394d53

Browse files
authored
[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).
1 parent 35f6080 commit b394d53

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

scripts/test-new-tests.mjs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -128,34 +128,19 @@ async function main() {
128128
}
129129
}
130130

131-
for (let i = 0; i < attempts; i++) {
132-
console.log(`\n\nRun ${i + 1}/${attempts} for ${testMode} tests (Webpack)`)
133-
134-
// We apply the external tests filter before the process.env so that if
135-
// it's defined in the environment, it overrides the default filter.
136-
// This is required for supporting the experimental tests setup.
137-
const NEXT_EXTERNAL_TESTS_FILTERS = process.env.NEXT_EXTERNAL_TESTS_FILTERS
138-
? process.env.NEXT_EXTERNAL_TESTS_FILTERS
139-
: testMode === 'deploy'
140-
? 'test/deploy-tests-manifest.json'
141-
: undefined
142-
143-
if (NEXT_EXTERNAL_TESTS_FILTERS) {
144-
console.log(
145-
`Applying external tests filter: ${NEXT_EXTERNAL_TESTS_FILTERS}`
146-
)
147-
}
131+
// We apply the external tests filter before the process.env so that if
132+
// it's defined in the environment, it overrides the default filter.
133+
// This is required for supporting the experimental tests setup.
134+
const NEXT_EXTERNAL_TESTS_FILTERS = process.env.NEXT_EXTERNAL_TESTS_FILTERS
135+
? process.env.NEXT_EXTERNAL_TESTS_FILTERS
136+
: testMode === 'deploy'
137+
? 'test/deploy-tests-manifest.json'
138+
: undefined
148139

149-
await execa('node', [...RUN_TESTS_ARGS, ...currentTests], {
150-
...EXECA_OPTS_STDIO,
151-
env: {
152-
...process.env,
153-
NEXT_EXTERNAL_TESTS_FILTERS,
154-
NEXT_TEST_MODE: testMode,
155-
NEXT_TEST_VERSION: nextTestVersion,
156-
IS_WEBPACK_TEST: '1',
157-
},
158-
})
140+
if (NEXT_EXTERNAL_TESTS_FILTERS) {
141+
console.log(
142+
`Applying external tests filter: ${NEXT_EXTERNAL_TESTS_FILTERS}`
143+
)
159144
}
160145

161146
if (isFlakeDetectionMode && testMode !== 'deploy') {
@@ -175,6 +160,21 @@ async function main() {
175160
},
176161
})
177162
}
163+
} else {
164+
for (let i = 0; i < attempts; i++) {
165+
console.log(`\n\nRun ${i + 1}/${attempts} for ${testMode} tests`)
166+
167+
await execa('node', [...RUN_TESTS_ARGS, ...currentTests], {
168+
...EXECA_OPTS_STDIO,
169+
env: {
170+
...process.env,
171+
NEXT_EXTERNAL_TESTS_FILTERS,
172+
NEXT_TEST_MODE: testMode,
173+
NEXT_TEST_VERSION: nextTestVersion,
174+
IS_WEBPACK_TEST: '1',
175+
},
176+
})
177+
}
178178
}
179179
}
180180

0 commit comments

Comments
 (0)