mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
tasks: skip writing junit no failure if it has already been reported
This commit is contained in:
parent
4fdc8317a0
commit
28e8c4ed1d
@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-await-in-loop */
|
||||
import { AbortController } from 'node-abort-controller';
|
||||
import type { AbortController } from 'node-abort-controller';
|
||||
import { getJunitXml } from 'junit-xml';
|
||||
import { outputFile, existsSync, readFile } from 'fs-extra';
|
||||
import { join, resolve } from 'path';
|
||||
@ -7,7 +7,8 @@ import { prompt } from 'prompts';
|
||||
import boxen from 'boxen';
|
||||
import { dedent } from 'ts-dedent';
|
||||
|
||||
import { createOptions, getCommand, getOptionsOrPrompt, OptionValues } from './utils/options';
|
||||
import type { OptionValues } from './utils/options';
|
||||
import { createOptions, getCommand, getOptionsOrPrompt } from './utils/options';
|
||||
import { install } from './tasks/install';
|
||||
import { compile } from './tasks/compile';
|
||||
import { check } from './tasks/check';
|
||||
@ -278,7 +279,10 @@ async function runTask(task: Task, details: TemplateDetails, optionValues: Passe
|
||||
|
||||
return controller;
|
||||
} catch (err) {
|
||||
if (junitFilename) await writeJunitXml(getTaskKey(task), details.key, startTime, err);
|
||||
// If there's a non-test related error (junit report has not been reported already), we report the general failure in a junit report
|
||||
if (junitFilename && !existsSync(junitFilename)) {
|
||||
await writeJunitXml(getTaskKey(task), details.key, startTime, err);
|
||||
}
|
||||
|
||||
throw err;
|
||||
} finally {
|
||||
|
Loading…
x
Reference in New Issue
Block a user