-
Notifications
You must be signed in to change notification settings - Fork 33
feat: list relevant audits on category failure #56
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
Conversation
34c336e
to
2104248
Compare
@ehmicky, thanks I'm still improving it (the build summary with the error is too verbose. I would like it to only show the failed categories and the specific audits should show up in the logs). |
36d4360
to
bbc3bee
Compare
category.title, | ||
)} to be greater or equal to ${chalk.green(expected)} but got ${chalk.red( | ||
category.score !== null ? category.score : 'unknown', | ||
)}`; | ||
|
||
const categoryAudits = category.auditRefs | ||
.filter(({ weight, id }) => weight > 0 && audits[id].score < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only list audits that donated to the category score based on weight, and also ignore audits with a perfect score
@@ -126,34 +141,53 @@ const runAudit = async ({ path, url, thresholds }) => { | |||
return { | |||
summary, | |||
shortSummary, | |||
error: errors.length > 0 ? new Error(`\n${errors.join('\n')}`) : false, | |||
errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't format the message here so we can create both a short message and a detailed message later on.
bbc3bee
to
0e0ce82
Compare
failBuild(chalk.red('Failed with error:\n'), { error }); | ||
if (error.details) { | ||
console.error(error.details); | ||
failBuild(`${chalk.red('Failed with error:\n')}${error.message}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the internal stack trace in this case.
@ehmicky this is ready (I updated the deploy log and PR description) |
🎉 This PR is included in version 1.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes https://github.com/netlify-labs/netlify-plugin-lighthouse/issues/46
Prints a detailed version with specific audits to the log, and report a short version (only categories) to be shown in the UI summary.
Build log:
https://app.netlify.com/sites/plugin-lighthouse/deploys/5f184ada44438d0008132480