ModusCreateOrg / gimbal

Web Performance Auditing tooling

Home Page:https://labs.moduscreate.com/gimbal-web-performance-audit-budgeting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lighthouse html in artifacts

grgur opened this issue · comments

We should include lighthouse.html in artifacts so engineers can look at it when CI fails.

The issue with executing lighthouse programmatically is the outputs are different than when you execute via the cli. If you change the output setting that defaults to json to be html so that the report generated is the HTML but we wouldn't be able to parse it because it's not JSON anymore.

We may be able to get down to the ReportGenerator class to turn the lhr into html: https://github.com/GoogleChrome/lighthouse/blob/81a8a5cb3d5e785494fe8549cbe747de2325c17c/lighthouse-core/report/report-generator.js#L35

@mitchellsimoens you can output both json and html from lighthouse by providing both switches. Am I missing the point?

We aren’t executing it via cli and of course setting the property twice in an object doesn’t work the same, unless it supports an array of strings but the docs say it uses the same property in the response.

Based on Lighthouse type def it looks like output can take an array. @mitchellsimoens do you think that could be the solution?

Per https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#differences-from-cli-flags, it says this for outputPath:

Ignored, output is returned as string in .report property.

Also, lighthouse typings are very unfinished (per them too) so an input vs output difference wouldn't be surprising at all either. No use keep talking until someone actually tries it.