Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: do not use test patterns in sharding tests #48768

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/parallel/test-runner-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require('../common');
const assert = require('assert');
const { spawnSync } = require('child_process');
const { join } = require('path');
const { readdirSync } = require('fs');
const fixtures = require('../common/fixtures');
const testFixtures = fixtures.path('test-runner');

Expand Down Expand Up @@ -269,10 +270,12 @@ const testFixtures = fixtures.path('test-runner');

{
// --test-shard option, first shard
const shardsTestPath = join(testFixtures, 'shards');
const allShardsTestsFiles = readdirSync(shardsTestPath).map((file) => join(shardsTestPath, file));
const args = [
'--test',
'--test-shard=1/2',
join(testFixtures, 'shards/*.cjs'),
...allShardsTestsFiles,
];
const child = spawnSync(process.execPath, args);

Expand Down Expand Up @@ -303,10 +306,12 @@ const testFixtures = fixtures.path('test-runner');

{
// --test-shard option, last shard
const shardsTestPath = join(testFixtures, 'shards');
const allShardsTestsFiles = readdirSync(shardsTestPath).map((file) => join(shardsTestPath, file));
const args = [
'--test',
'--test-shard=2/2',
join(testFixtures, 'shards/*.cjs'),
...allShardsTestsFiles,
];
const child = spawnSync(process.execPath, args);

Expand Down