Skip to content

Commit 4487e9d

Browse files
filipesilvaclydin
authored andcommitted
test: shard test-large
1 parent 1809438 commit 4487e9d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ jobs:
4747
test-large:
4848
<<: *defaults
4949
resource_class: large
50+
parallelism: 4
5051
steps:
5152
- checkout: *post_checkout
5253
- restore_cache: *_root_package_lock_key
5354
- run: npm run webdriver-update-circleci
54-
- run: npm run test-large -- --code-coverage --full
55+
- run: npm run test-large -- --code-coverage --full --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX}
5556

5657
e2e-cli:
5758
<<: *defaults

scripts/test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ export default function (args: ParsedArgs, logger: logging.Logger) {
209209
logger.info(`Found ${tests.length} spec files, out of ${allTests.length}.`);
210210
}
211211

212+
if (args.shard !== undefined) {
213+
// Remove tests that are not part of this shard.
214+
const shardId = args['shard'];
215+
const nbShards = args['nb-shards'] || 2;
216+
tests = tests.filter((name, i) => (i % nbShards) == shardId);
217+
}
218+
212219
return new Promise(resolve => {
213220
runner.onComplete((passed: boolean) => resolve(passed ? 0 : 1));
214221
runner.execute(tests);

0 commit comments

Comments
 (0)