From 16f664e22c4e4a473666e10bb7b6ee0a28ac7aa7 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 27 Apr 2023 17:25:29 -0700 Subject: [PATCH] chore: write blob report to the config dir by default (#22697) --- packages/playwright-test/src/reporters/blob.ts | 10 +--------- packages/playwright-test/src/reporters/html.ts | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/playwright-test/src/reporters/blob.ts b/packages/playwright-test/src/reporters/blob.ts index 500e7cf050..c911e96c6b 100644 --- a/packages/playwright-test/src/reporters/blob.ts +++ b/packages/playwright-test/src/reporters/blob.ts @@ -23,7 +23,6 @@ import { yazl } from 'playwright-core/lib/zipBundle'; import { Readable } from 'stream'; import type { FullConfig, FullResult, TestResult } from '../../types/testReporter'; import type { Suite } from '../common/test'; -import { defaultReportFolder } from './html'; import { TeleReporterEmitter } from './teleEmitter'; @@ -83,7 +82,7 @@ export class BlobReporter extends TeleReporterEmitter { } private _computeOutputFileName(config: FullConfig) { - const outputDir = this._resolveOutputDir(); + const outputDir = path.resolve(this._options.configDir, this._options.outputDir || ''); let shardSuffix = ''; if (config.shard) { const paddedNumber = `${config.shard.current}`.padStart(`${config.shard.total}`.length, '0'); @@ -91,11 +90,4 @@ export class BlobReporter extends TeleReporterEmitter { } return path.join(outputDir, `report${shardSuffix}.zip`); } - - private _resolveOutputDir(): string { - const { outputDir } = this._options; - if (outputDir) - return path.resolve(this._options.configDir, outputDir); - return defaultReportFolder(this._options.configDir); - } } diff --git a/packages/playwright-test/src/reporters/html.ts b/packages/playwright-test/src/reporters/html.ts index 0e8c4c6655..b514937764 100644 --- a/packages/playwright-test/src/reporters/html.ts +++ b/packages/playwright-test/src/reporters/html.ts @@ -142,7 +142,7 @@ function reportFolderFromEnv(): string | undefined { return undefined; } -export function defaultReportFolder(searchForPackageJson: string): string { +function defaultReportFolder(searchForPackageJson: string): string { let basePath = getPackageJsonPath(searchForPackageJson); if (basePath) basePath = path.dirname(basePath);