Skip to content

Commit e7d7b86

Browse files
authored
CI optimization: fixed duplicating tests in jobs (#31304) (#31306)
1 parent 0696ae2 commit e7d7b86

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

e2e/testcafe-devextreme/runner.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import createTestCafe, { ClientFunction } from 'testcafe';
22
import * as fs from 'fs';
3-
import * as path from 'path';
43
import * as process from 'process';
54
import parseArgs from 'minimist';
65
import { globSync } from 'glob';
@@ -188,6 +187,7 @@ createTestCafe(TESTCAFE_CONFIG)
188187
const fixtures = globSync([`./tests/${componentFolder}/*.ts`]);
189188
const fixtureChunks = split(fixtures, total);
190189
const targetFixtureChunk = fixtureChunks[current - 1] ?? [];
190+
const targetFixtureChunkSet = new Set(targetFixtureChunk);
191191

192192
/* eslint-disable no-console */
193193
console.info(' === test run config ===');
@@ -197,15 +197,14 @@ createTestCafe(TESTCAFE_CONFIG)
197197
console.info(' > fixtures: ', targetFixtureChunk, '\n');
198198
/* eslint-enable no-console */
199199

200-
const targetBaseNames = new Set(
201-
targetFixtureChunk.map((filePath) => path.basename(filePath)),
202-
);
203-
204200
filters.push((
205201
_testName: string,
206202
_fixtureName: string,
207203
fixturePath: string,
208-
) => targetBaseNames.has(path.basename(fixturePath)));
204+
) => {
205+
const testPath = fixturePath.split('/testcafe-devextreme/')[1];
206+
return targetFixtureChunkSet.has(testPath);
207+
});
209208
}
210209

211210
if (testName) {
@@ -275,6 +274,7 @@ createTestCafe(TESTCAFE_CONFIG)
275274
process.exit(failedCount);
276275
})
277276
.catch((error: Error) => {
277+
// eslint-disable-next-line no-console
278278
console.error('TestCafe execution failed:', error);
279279
if (testCafe) {
280280
// eslint-disable-next-line @typescript-eslint/no-floating-promises

0 commit comments

Comments
 (0)