From c38e27598cef87df80d8643efb863f3f9d8cb6d1 Mon Sep 17 00:00:00 2001 From: Julia Volkova Date: Mon, 13 Oct 2025 11:26:25 +0300 Subject: [PATCH] CI optimization: fixed duplicating tests in jobs (#31304) --- e2e/testcafe-devextreme/runner.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e2e/testcafe-devextreme/runner.ts b/e2e/testcafe-devextreme/runner.ts index 9c7a56200da8..8bfc2537e1d0 100644 --- a/e2e/testcafe-devextreme/runner.ts +++ b/e2e/testcafe-devextreme/runner.ts @@ -1,6 +1,5 @@ import createTestCafe, { ClientFunction } from 'testcafe'; import * as fs from 'fs'; -import * as path from 'path'; import * as process from 'process'; import parseArgs from 'minimist'; import { globSync } from 'glob'; @@ -188,6 +187,7 @@ createTestCafe(TESTCAFE_CONFIG) const fixtures = globSync([`./tests/${componentFolder}/*.ts`]); const fixtureChunks = split(fixtures, total); const targetFixtureChunk = fixtureChunks[current - 1] ?? []; + const targetFixtureChunkSet = new Set(targetFixtureChunk); /* eslint-disable no-console */ console.info(' === test run config ==='); @@ -197,15 +197,14 @@ createTestCafe(TESTCAFE_CONFIG) console.info(' > fixtures: ', targetFixtureChunk, '\n'); /* eslint-enable no-console */ - const targetBaseNames = new Set( - targetFixtureChunk.map((filePath) => path.basename(filePath)), - ); - filters.push(( _testName: string, _fixtureName: string, fixturePath: string, - ) => targetBaseNames.has(path.basename(fixturePath))); + ) => { + const testPath = fixturePath.split('/testcafe-devextreme/')[1]; + return targetFixtureChunkSet.has(testPath); + }); } if (testName) { @@ -275,6 +274,7 @@ createTestCafe(TESTCAFE_CONFIG) process.exit(failedCount); }) .catch((error: Error) => { + // eslint-disable-next-line no-console console.error('TestCafe execution failed:', error); if (testCafe) { // eslint-disable-next-line @typescript-eslint/no-floating-promises