From 6884fd715f344d6949074284a85c2f7445c47fa5 Mon Sep 17 00:00:00 2001 From: Mathias Leppich Date: Wed, 29 May 2024 11:28:16 +0200 Subject: [PATCH] remove special handling of merged test ids --- packages/playwright/src/reporters/lastrun.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/playwright/src/reporters/lastrun.ts b/packages/playwright/src/reporters/lastrun.ts index c23cce0776..6840c6c780 100644 --- a/packages/playwright/src/reporters/lastrun.ts +++ b/packages/playwright/src/reporters/lastrun.ts @@ -25,11 +25,6 @@ type LastRunOptions = { _mode: 'list' | 'test' | 'merge', }; -// The blob reporter adds a suffix to test ids to avoid collisions. But we need -// to remove that suffix to match the test ids from the last run. -function unsaltTestId(testId: string): string { - return testId.split('-').map(s => s.substring(0, 20)).join('-'); -} class LastRunReporter extends BaseReporter { @@ -40,12 +35,10 @@ class LastRunReporter extends BaseReporter { }; private resolvedOutputFile: string | undefined; - private testId: (testId: string) => string; constructor(options: LastRunOptions) { super(); this.resolvedOutputFile = resolveOutputFile('LASTRUN', { fileName: '.last-run.json', ...options })?.outputFile; - this.testId = options._mode === 'merge' ? unsaltTestId : (testId: string) => testId; } override printsToStdio() { @@ -54,9 +47,9 @@ class LastRunReporter extends BaseReporter { override onTestEnd(test: TestCase, result: TestResult): void { super.onTestEnd(test, result); - this.lastRun.testDurations![this.testId(test.id)] = result.duration; + this.lastRun.testDurations![test.id] = result.duration; if (result.status === 'failed') - this.lastRun.failedTests.push(this.testId(test.id)); + this.lastRun.failedTests.push(test.id); } override async onEnd(result: FullResult) {