-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
core: add group support for plugins #7304
Conversation
Update tests to ensure groups are added properly.
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.
Thanks for the contribution @jburger424!! mind posting a screenshot with the motivating example? :)
Apologies if you may have already communicated this internally, and I'm just out of the loop.
The motivating example for this is our plugin Ad Speed Insights. |
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.
LGTM % few nits
I'll defer to @brendankenny, the plugin master, though for approval.
Minor changes in response to PR comments.
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.
thanks for doing this and for all those tests! 😍
just a few changes, mostly nits
@@ -84,6 +93,7 @@ describe('ConfigPlugin', () => { | |||
categories: { | |||
'lighthouse-plugin-evil': evilCategory, | |||
}, | |||
groups: undefined, |
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.
do these two additions add anything to the test? My brain may be just foggy today and I'm missing it :)
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.
Tests were failing without this because the undefined group object is not yet stripped at this point.
audits: [ | ||
{path: 'redirects'}, | ||
{path: 'user-timings'}, | ||
], | ||
category: { | ||
title: 'Simple', | ||
auditRefs: [], | ||
auditRefs: [ | ||
{id: 'redirects', weight: 1, group: 'new-group'}, |
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.
oh, ha, there weren't any audit refs to add a group to before. Sorry I missed that :)
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.
LGTM! Thanks again for taking this on
Summary
Allow for plugin to add custom groups and assign custom to plugin auditRefs.
Modify tests to verify groups added and assigned properly.
Related Issues/PRs
#6959
#6070