Skip to content

Commit 4c3902a

Browse files
committed
fix test detection
1 parent 10cd901 commit 4c3902a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/browser-integration-tests/scripts/detectFlakyTests.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ const exec = promisify(childProcess.exec);
77

88
async function run(): Promise<void> {
99
let testPaths = getTestPaths();
10+
let failed = [];
1011

1112
try {
1213
const changedPaths: string[] = process.env.CHANGED_TEST_PATHS ? JSON.parse(process.env.CHANGED_TEST_PATHS) : [];
1314

1415
if (changedPaths.length > 0) {
1516
console.log(`Detected changed test paths:
16-
${changedPaths.join('\n')}`);
17+
${changedPaths.join('\n')}
1718
18-
testPaths = testPaths.filter(p => changedPaths.some(changedPath => p.includes(changedPath)));
19+
`);
20+
21+
testPaths = testPaths.filter(p => changedPaths.some(changedPath => changedPath.includes(p)));
1922
}
2023
} catch {
2124
console.log('Could not detect changed test paths, running all tests.');
@@ -36,8 +39,14 @@ ${changedPaths.join('\n')}`);
3639
console.log(` ☑️ Passed ${runCount} times, avg. duration ${Math.ceil((end - start) / runCount)}ms`);
3740
} catch (error) {
3841
logError(error);
42+
failed.push(testPath);
3943
}
4044
}
45+
46+
if (failed.length > 0) {
47+
console.log('');
48+
console.error(`⚠️ ${failed.length} test(s) failed.`);
49+
}
4150
}
4251

4352
function getTestPaths(): string[] {

0 commit comments

Comments
 (0)