From e31e5b1b7c7628921875c98cc98ebdfb2b53b766 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 13 Dec 2023 18:47:13 -0800 Subject: [PATCH] fix: use blob fileName as is without adding shard suffix (#28634) Fixes https://github.com/microsoft/playwright/issues/27284 --- .github/workflows/tests_primary.yml | 4 ++-- packages/playwright/src/reporters/blob.ts | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml index b117bb2267..a76dc9fd3c 100644 --- a/.github/workflows/tests_primary.yml +++ b/.github/workflows/tests_primary.yml @@ -131,11 +131,11 @@ jobs: - run: npx playwright install --with-deps - run: npm run ttest -- --shard ${{ matrix.shard }} env: - PWTEST_BOT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}" + PWTEST_BOT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}-${{ matrix.shard }}" if: matrix.os != 'ubuntu-latest' - run: xvfb-run npm run ttest -- --shard ${{ matrix.shard }} env: - PWTEST_BOT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}" + PWTEST_BOT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}-${{ matrix.shard }}" if: matrix.os == 'ubuntu-latest' - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() diff --git a/packages/playwright/src/reporters/blob.ts b/packages/playwright/src/reporters/blob.ts index f15fe6f87d..192b639a5a 100644 --- a/packages/playwright/src/reporters/blob.ts +++ b/packages/playwright/src/reporters/blob.ts @@ -109,12 +109,14 @@ export class BlobReporter extends TeleReporterEmitter { } private _computeReportName(config: FullConfig) { - let reportName = this._options.fileName ?? 'report.zip'; + if (this._options.fileName) + return this._options.fileName; + let reportName = 'report'; if (config.shard) { const paddedNumber = `${config.shard.current}`.padStart(`${config.shard.total}`.length, '0'); - reportName = `${reportName.slice(0, -4)}-${paddedNumber}.zip`; + reportName = `${reportName}-${paddedNumber}`; } - return reportName; + return `${reportName}.zip`; } override _serializeAttachments(attachments: TestResult['attachments']): JsonAttachment[] {