If a browsertime marks a test as a failure, exit with error code (#4047)
This commit is contained in:
parent
569a400219
commit
e0832c5723
|
|
@ -148,6 +148,14 @@ async function start() {
|
||||||
execSync('xdg-open ' + result.localPath + '/index.html');
|
execSync('xdg-open ' + result.localPath + '/index.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If one of the URLs is marked as a failure in Browsertime
|
||||||
|
// then set the exit code
|
||||||
|
for (let bt of result.browsertime) {
|
||||||
|
if (bt.markedAsFailure === 1) {
|
||||||
|
process.exitCode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
parsed.options.budget &&
|
parsed.options.budget &&
|
||||||
Object.keys(result.budgetResult.failing).length > 0
|
Object.keys(result.budgetResult.failing).length > 0
|
||||||
|
|
|
||||||
|
|
@ -364,6 +364,8 @@ export default class BrowsertimePlugin extends SitespeedioPlugin {
|
||||||
run.extras = result[resultIndex].extras[runIndex];
|
run.extras = result[resultIndex].extras[runIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run.markedAsFailure = result[resultIndex].markedAsFailure;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
result[resultIndex].cdp &&
|
result[resultIndex].cdp &&
|
||||||
result[resultIndex].cdp.performance
|
result[resultIndex].cdp.performance
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue