ci: shard API v2 E2E tests into 4 parallel jobs (#26183)
* ci: shard API v2 E2E tests into 4 parallel jobs Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * check * Fix typo in workflow name from 'Update' to 'Updatee' * Rename workflow from 'PR Updatee' to 'PR Update' * update * test * update * fix * update * check * remove * revert --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
4 files changed
+86
-20
No files matched your search
+18
-1
@@ -1,5 +1,22 @@
|
||||
import type { Config } from "jest";
|
||||
|
||||
// Detect if sharding is being used by checking for --shard flag
|
||||
const isSharding = process.argv.some((arg) => arg.includes("--shard"));
|
||||
|
||||
// For Jest e2e, we reduce parallelism when sharding in CI to improve test isolation
|
||||
// since tests share database state and can interfere with each other
|
||||
const getMaxWorkers = () => {
|
||||
if (process.env.CI && isSharding) {
|
||||
// In CI with sharding: reduce workers to improve test isolation
|
||||
// Sharding already provides parallelism across shards (4 parallel jobs)
|
||||
return 4;
|
||||
}
|
||||
// Local development or non-sharded: use more workers (similar to Playwright)
|
||||
return 8;
|
||||
};
|
||||
|
||||
const maxWorkers = getMaxWorkers();
|
||||
|
||||
const config: Config = {
|
||||
preset: "ts-jest",
|
||||
moduleFileExtensions: ["js", "json", "ts"],
|
||||
@@ -17,7 +34,7 @@ const config: Config = {
|
||||
setupFilesAfterEnv: ["<rootDir>/test/jest.setup-e2e.ts"],
|
||||
reporters: ["default", "jest-summarizing-reporter"],
|
||||
workerIdleMemoryLimit: "512MB",
|
||||
maxWorkers: 8,
|
||||
maxWorkers,
|
||||
testPathIgnorePatterns: ["/dist/", "/node_modules/"],
|
||||
transformIgnorePatterns: ["/dist/", "/node_modules/"],
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user