Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc(build): create error-y LHR for the deploy #9283

Merged
merged 11 commits into from
Jun 29, 2019
Prev Previous commit
Next Next commit
add runwarning
  • Loading branch information
paulirish committed Jun 26, 2019
commit 10d1e03623805ddb97a960d277757d5028073631
7 changes: 6 additions & 1 deletion lighthouse-core/scripts/build-report-for-autodeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@ async function generateErrorLHR() {
mkdirp(TMP);
fs.writeFileSync(`${TMP}/artifacts.json`, JSON.stringify(artifacts), 'utf-8');
const errorRunnerResult = await lighthouse(url, {auditMode: TMP});
return /** @type {LH.RunnerResult} */ (errorRunnerResult).lhr;
const errorLhr = /** @type {LH.RunnerResult} */ (errorRunnerResult).lhr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need a cast?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because lighthouse can return RunnerResult | undefined (i think because of -G?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because lighthouse can return RunnerResult | undefined (i think because of -G?)

ah, oh right. I prefer the real undefined check over the cast personally, but not a big deal in this case

errorLhr.runWarnings = [
'Something went wrong with recording the trace over your page load. ' +
'Please run Lighthouse again. (NO_FCP)'
];
return errorLhr;
}