chore: hide reporter project id (#17710)
This commit is contained in:
parent
b4ee84fb0c
commit
a97deb1600
|
|
@ -150,13 +150,6 @@ Filter to only run tests with a title **not** matching one of the patterns. This
|
|||
|
||||
`grepInvert` option is also useful for [tagging tests](../test-annotations.md#tag-tests).
|
||||
|
||||
## property: TestProject.id
|
||||
* since: v1.27
|
||||
- type: ?<[string]>
|
||||
|
||||
Unique project id within this config.
|
||||
|
||||
|
||||
## property: TestProject.metadata
|
||||
* since: v1.10
|
||||
- type: ?<[Metadata]>
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ export class Loader {
|
|||
const candidate = name + (i ? i : '');
|
||||
if (usedNames.has(candidate))
|
||||
continue;
|
||||
p.id = candidate;
|
||||
p._id = candidate;
|
||||
usedNames.add(candidate);
|
||||
break;
|
||||
}
|
||||
|
|
@ -290,7 +290,7 @@ export class Loader {
|
|||
process.env.PWTEST_USE_SCREENSHOTS_DIR = '1';
|
||||
}
|
||||
return {
|
||||
id: '',
|
||||
_id: '',
|
||||
_fullConfig: fullConfig,
|
||||
_fullyParallel: takeFirst(projectConfig.fullyParallel, config.fullyParallel, undefined),
|
||||
_expect: takeFirst(projectConfig.expect, config.expect, {}),
|
||||
|
|
@ -402,20 +402,20 @@ class ProjectSuiteBuilder {
|
|||
test.retries = this._project.retries;
|
||||
const repeatEachIndexSuffix = repeatEachIndex ? ` (repeat:${repeatEachIndex})` : '';
|
||||
// At the point of the query, suite is not yet attached to the project, so we only get file, describe and test titles.
|
||||
const testIdExpression = `[project=${this._project.id}]${test.titlePath().join('\x1e')}${repeatEachIndexSuffix}`;
|
||||
const testIdExpression = `[project=${this._project._id}]${test.titlePath().join('\x1e')}${repeatEachIndexSuffix}`;
|
||||
const testId = to._fileId + '-' + calculateSha1(testIdExpression).slice(0, 20);
|
||||
test.id = testId;
|
||||
test.repeatEachIndex = repeatEachIndex;
|
||||
test._projectId = this._project.id;
|
||||
test._projectId = this._project._id;
|
||||
if (!filter(test)) {
|
||||
to._entries.pop();
|
||||
to.tests.pop();
|
||||
} else {
|
||||
const pool = this._buildPool(entry);
|
||||
if (this._project._fullConfig._workerIsolation === 'isolate-pools')
|
||||
test._workerHash = `run${this._project.id}-${pool.digest}-repeat${repeatEachIndex}`;
|
||||
test._workerHash = `run${this._project._id}-${pool.digest}-repeat${repeatEachIndex}`;
|
||||
else
|
||||
test._workerHash = `run${this._project.id}-repeat${repeatEachIndex}`;
|
||||
test._workerHash = `run${this._project._id}-repeat${repeatEachIndex}`;
|
||||
test._pool = pool;
|
||||
}
|
||||
}
|
||||
|
|
@ -447,7 +447,7 @@ class ProjectSuiteBuilder {
|
|||
(originalFixtures as any)[key] = value;
|
||||
}
|
||||
if (Object.entries(optionsFromConfig).length)
|
||||
result.push({ fixtures: optionsFromConfig, location: { file: `project#${this._project.id}`, line: 1, column: 1 } });
|
||||
result.push({ fixtures: optionsFromConfig, location: { file: `project#${this._project._id}`, line: 1, column: 1 } });
|
||||
if (Object.entries(originalFixtures).length)
|
||||
result.push({ fixtures: originalFixtures, location: f.location });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class JSONReporter implements Reporter {
|
|||
repeatEach: project.repeatEach,
|
||||
retries: project.retries,
|
||||
metadata: project.metadata,
|
||||
id: project.id,
|
||||
id: (project as any)._id,
|
||||
name: project.name,
|
||||
testDir: toPosixPath(project.testDir),
|
||||
testIgnore: serializePatterns(project.testIgnore),
|
||||
|
|
@ -80,7 +80,7 @@ class JSONReporter implements Reporter {
|
|||
private _mergeSuites(suites: Suite[]): JSONReportSuite[] {
|
||||
const fileSuites = new MultiMap<string, JSONReportSuite>();
|
||||
for (const projectSuite of suites) {
|
||||
const projectId = projectSuite.project()!.id;
|
||||
const projectId = (projectSuite.project() as any)._id;
|
||||
const projectName = projectSuite.project()!.name;
|
||||
for (const fileSuite of projectSuite.suites) {
|
||||
const file = fileSuite.location!.file;
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ export class TestInfoImpl implements TestInfo {
|
|||
const fullTitleWithoutSpec = test.titlePath().slice(1).join(' ');
|
||||
|
||||
let testOutputDir = trimLongString(sanitizedRelativePath + '-' + sanitizeForFilePath(fullTitleWithoutSpec));
|
||||
if (project.id)
|
||||
testOutputDir += '-' + sanitizeForFilePath(project.id);
|
||||
if (project._id)
|
||||
testOutputDir += '-' + sanitizeForFilePath(project._id);
|
||||
if (this.retry)
|
||||
testOutputDir += '-retry' + this.retry;
|
||||
if (this.repeatEachIndex)
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export interface FullConfigInternal extends FullConfigPublic {
|
|||
* increasing the surface area of the public API type called FullProject.
|
||||
*/
|
||||
export interface FullProjectInternal extends FullProjectPublic {
|
||||
_id: string;
|
||||
_fullConfig: FullConfigInternal;
|
||||
_fullyParallel: boolean;
|
||||
_expect: Project['expect'];
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ export class WorkerRunner extends EventEmitter {
|
|||
return;
|
||||
|
||||
this._loader = await Loader.deserialize(this._params.loader);
|
||||
this._project = this._loader.fullConfig().projects.find(p => p.id === this._params.projectId)!;
|
||||
this._project = this._loader.fullConfig().projects.find(p => p._id === this._params.projectId)!;
|
||||
}
|
||||
|
||||
async runTestGroup(runPayload: RunPayload) {
|
||||
|
|
|
|||
9
packages/playwright-test/types/test.d.ts
vendored
9
packages/playwright-test/types/test.d.ts
vendored
|
|
@ -198,10 +198,6 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||
* Metadata that will be put directly to the test report serialized as JSON.
|
||||
*/
|
||||
metadata: Metadata;
|
||||
/**
|
||||
* Unique project id within this config.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Project name is visible in the report and during test execution.
|
||||
*/
|
||||
|
|
@ -4434,11 +4430,6 @@ interface TestProject {
|
|||
*/
|
||||
grepInvert?: RegExp|Array<RegExp>;
|
||||
|
||||
/**
|
||||
* Unique project id within this config.
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Metadata that will be put directly to the test report serialized as JSON.
|
||||
*/
|
||||
|
|
|
|||
1
utils/generate_types/overrides-test.d.ts
vendored
1
utils/generate_types/overrides-test.d.ts
vendored
|
|
@ -41,7 +41,6 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||
grep: RegExp | RegExp[];
|
||||
grepInvert: RegExp | RegExp[] | null;
|
||||
metadata: Metadata;
|
||||
id: string;
|
||||
name: string;
|
||||
snapshotDir: string;
|
||||
outputDir: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue