diff --git a/bin/sitespeed.js b/bin/sitespeed.js index bcbd7fcec5..6570b2ceba 100755 --- a/bin/sitespeed.js +++ b/bin/sitespeed.js @@ -148,6 +148,14 @@ async function start() { 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 ( parsed.options.budget && Object.keys(result.budgetResult.failing).length > 0 diff --git a/lib/plugins/browsertime/index.js b/lib/plugins/browsertime/index.js index b761af7bc3..ab9ae4244c 100644 --- a/lib/plugins/browsertime/index.js +++ b/lib/plugins/browsertime/index.js @@ -364,6 +364,8 @@ export default class BrowsertimePlugin extends SitespeedioPlugin { run.extras = result[resultIndex].extras[runIndex]; } + run.markedAsFailure = result[resultIndex].markedAsFailure; + if ( result[resultIndex].cdp && result[resultIndex].cdp.performance