mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: write blob report to the config dir by default (#22697)
This commit is contained in:
parent
f08caea8f2
commit
16f664e22c
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user