feedback
This commit is contained in:
parent
86422bb6d7
commit
23d755d104
|
|
@ -112,12 +112,6 @@ Base directory for all relative paths used in the reporters.
|
|||
|
||||
See [`property: TestConfig.shard`].
|
||||
|
||||
## property: FullConfig.shardingSeed
|
||||
* since: ???
|
||||
- type: <[null]|[string]>
|
||||
|
||||
See [`property: TestConfig.shardingSeed`].
|
||||
|
||||
## property: FullConfig.updateSnapshots
|
||||
* since: v1.10
|
||||
- type: <[UpdateSnapshots]<"all"|"none"|"missing">>
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ export default defineConfig({
|
|||
|
||||
## property: TestConfig.shardingSeed
|
||||
|
||||
* since: ???
|
||||
* since: v1.45
|
||||
- type: ?<[string]>
|
||||
|
||||
Shuffle the order of test groups with a seed. By default tests are run in the order they are discovered, which is mostly alphabetical. This could lead to an uneven distribution of slow and fast tests. Shuffling the order of tests in a deterministic way can help to distribute the load more evenly.
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ export class FullConfigInternal {
|
|||
cliFailOnFlakyTests?: boolean;
|
||||
testIdMatcher?: Matcher;
|
||||
defineConfigWasUsed = false;
|
||||
shardingSeed: string | null;
|
||||
|
||||
constructor(location: ConfigLocation, userConfig: Config, configCLIOverrides: ConfigCLIOverrides) {
|
||||
if (configCLIOverrides.projects && userConfig.projects)
|
||||
|
|
@ -87,12 +88,12 @@ export class FullConfigInternal {
|
|||
quiet: takeFirst(configCLIOverrides.quiet, userConfig.quiet, false),
|
||||
projects: [],
|
||||
shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null),
|
||||
shardingSeed: takeFirst(configCLIOverrides.shardingSeed, userConfig.shardingSeed, null),
|
||||
updateSnapshots: takeFirst(configCLIOverrides.updateSnapshots, userConfig.updateSnapshots, 'missing'),
|
||||
version: require('../../package.json').version,
|
||||
workers: 0,
|
||||
webServer: null,
|
||||
};
|
||||
this.shardingSeed = takeFirst(configCLIOverrides.shardingSeed, userConfig.shardingSeed, null);
|
||||
for (const key in userConfig) {
|
||||
if (key.startsWith('@'))
|
||||
(this.config as any)[key] = (userConfig as any)[key];
|
||||
|
|
|
|||
|
|
@ -595,7 +595,6 @@ export const baseFullConfig: reporterTypes.FullConfig = {
|
|||
rootDir: '',
|
||||
quiet: false,
|
||||
shard: null,
|
||||
shardingSeed: null,
|
||||
updateSnapshots: 'missing',
|
||||
version: '',
|
||||
workers: 0,
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ export async function createRootSuite(testRun: TestRun, errors: TestError[], sho
|
|||
for (const projectSuite of rootSuite.suites)
|
||||
testGroups.push(...createTestGroups(projectSuite, config.config.workers));
|
||||
|
||||
if (config.config.shardingSeed)
|
||||
shuffleWithSeed(testGroups, config.config.shardingSeed);
|
||||
if (config.shardingSeed)
|
||||
shuffleWithSeed(testGroups, config.shardingSeed);
|
||||
|
||||
// Shard test groups.
|
||||
const testGroupsInThisShard = filterForShard(config.config.shard, testGroups);
|
||||
|
|
|
|||
5
packages/playwright/types/test.d.ts
vendored
5
packages/playwright/types/test.d.ts
vendored
|
|
@ -1806,11 +1806,6 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||
current: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* See [testConfig.shardingSeed](https://playwright.dev/docs/api/class-testconfig#test-config-sharding-seed).
|
||||
*/
|
||||
shardingSeed: null|string;
|
||||
|
||||
/**
|
||||
* See [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots).
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue