mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
chore: delete --attachments option from merge-reports command (#24350)
We recommend uploading all resources along with the generated report. If need be we'll reconsider adding the option later.
This commit is contained in:
parent
d307c8e63a
commit
6a3721eb9c
@ -88,8 +88,6 @@ Examples:
|
||||
$ npx playwright show-report playwright-report`);
|
||||
}
|
||||
|
||||
const kAttachmentModes: string[] = ['local', 'missing'];
|
||||
|
||||
function addMergeReportsCommand(program: Command) {
|
||||
const command = program.command('merge-reports [dir]', { hidden: true });
|
||||
command.description('merge multiple blob reports (for sharded tests) into a single report');
|
||||
@ -103,7 +101,6 @@ function addMergeReportsCommand(program: Command) {
|
||||
});
|
||||
command.option('-c, --config <file>', `Configuration file. Can be used to specify additional configuration for the output report.`);
|
||||
command.option('--reporter <reporter>', `Reporter to use, comma-separated, can be ${builtInReporters.map(name => `"${name}"`).join(', ')} (default: "${defaultReporter}")`);
|
||||
command.option('--attachments <mode>', `Whether the attachments are available locally. Supported values are ${kAttachmentModes.map(name => `"${name}"`).join(', ')} (default: "local")`);
|
||||
command.addHelpText('afterAll', `
|
||||
Arguments [dir]:
|
||||
Directory containing blob reports.
|
||||
@ -200,12 +197,7 @@ async function mergeReports(reportDir: string | undefined, opts: { [key: string]
|
||||
reporterDescriptions = config.config.reporter;
|
||||
if (!reporterDescriptions)
|
||||
reporterDescriptions = [[defaultReporter]];
|
||||
if (opts.attachments) {
|
||||
if (!kAttachmentModes.includes(opts.attachments))
|
||||
throw new Error(`Invalid --attachments value "${opts.attachments}", must be one of ${kAttachmentModes.map(name => `"${name}"`).join(', ')}.`);
|
||||
}
|
||||
const resolveAttachmentPaths = opts.attachments !== 'missing';
|
||||
await createMergedReport(config, dir, reporterDescriptions!, resolveAttachmentPaths);
|
||||
await createMergedReport(config, dir, reporterDescriptions!);
|
||||
}
|
||||
|
||||
function overridesFromOptions(options: { [key: string]: any }): ConfigCLIOverrides {
|
||||
|
@ -26,13 +26,12 @@ import { Multiplexer } from './multiplexer';
|
||||
import { ZipFile } from 'playwright-core/lib/utils';
|
||||
import type { BlobReportMetadata } from './blob';
|
||||
|
||||
export async function createMergedReport(config: FullConfigInternal, dir: string, reporterDescriptions: ReporterDescription[], resolvePaths: boolean) {
|
||||
export async function createMergedReport(config: FullConfigInternal, dir: string, reporterDescriptions: ReporterDescription[]) {
|
||||
const shardFiles = await sortedShardFiles(dir);
|
||||
if (shardFiles.length === 0)
|
||||
throw new Error(`No report files found in ${dir}`);
|
||||
const events = await mergeEvents(dir, shardFiles);
|
||||
if (resolvePaths)
|
||||
patchAttachmentPaths(events, dir);
|
||||
patchAttachmentPaths(events, dir);
|
||||
|
||||
const reporters = await createReporters(config, 'merge', reporterDescriptions);
|
||||
const receiver = new TeleReporterReceiver(path.sep, new Multiplexer(reporters), false, config.config);
|
||||
|
@ -495,7 +495,7 @@ test('generate html with attachment urls', async ({ runInlineTest, mergeReports,
|
||||
const reportFiles = await fs.promises.readdir(reportDir);
|
||||
reportFiles.sort();
|
||||
expect(reportFiles).toEqual([expect.stringMatching(/report-.*.zip/), 'resources']);
|
||||
const { exitCode } = await mergeReports(reportDir, { 'PW_TEST_HTML_REPORT_OPEN': 'never' }, { additionalArgs: ['--reporter', 'html', '--attachments', 'missing'] });
|
||||
const { exitCode } = await mergeReports(reportDir, { 'PW_TEST_HTML_REPORT_OPEN': 'never' }, { additionalArgs: ['--reporter', 'html'] });
|
||||
expect(exitCode).toBe(0);
|
||||
|
||||
const htmlReportDir = test.info().outputPath('playwright-report');
|
||||
|
Loading…
Reference in New Issue
Block a user