chore: write blob report to the config dir by default (#22697)

This commit is contained in:
Yury Semikhatsky 2023-04-27 17:25:29 -07:00 committed by GitHub
parent f08caea8f2
commit 16f664e22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View File

@ -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);
}
}

View File

@ -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);