cli icon indicating copy to clipboard operation
cli copied to clipboard

`skipAudits` flag is not processed correctly by lighthouse

Open BioPhoton opened this issue 10 months ago • 0 comments

What happened?

When I configure a audit slug for skipAudits in the plugin options the audit is filtered out from the plugin config audits but the listed audits still show up in the audit outputs of the plugin. Therefor we had to implement the normalizeAuditOutputs function to overcome the validation.

What would you expect to happen?

That runLighthouse processes the passed flags correctly

What steps did you take?

Ensure original logic:

  1. ✅ run npx lighthouse https://example.com --skipAudits is-on-https --output json --output-path report.json
  2. ✅ ensure audits do NOT contain is-on-https
  3. ✅ ensure configSetings.skipAudits is set to ["is-on-https"]

Ensure cp logic:

  1. ✅ run nx code-pushup -- --onlyPlugins lighthouse with the following plugin configuration
 await lighthousePlugin('https://codepushup.dev/', { skipAudits: ['is-on-https'] })
  1. ✅ ensure skipAudits is passed into runLighthouse
  2. ❌ ensure audits do NOT contain is-on-https => the audit is present
  3. ✅ ensure configSetings.skipAudits is set to ["is-on-https"]

Related source links:

  • https://github.com/GoogleChrome/lighthouse/blob/65b65250e7854adcd9ecadeb5299aa4c80fdafc8/cli/run.js#L137
  • https://github.com/GoogleChrome/lighthouse/blob/c35b375c6f31c6d658dd65d9ab91f158eec759f0/core/config/filters.js#L265

Code PushUp package version

No response

What operation system are you on?

MacOS

Node version

No response

Relevant log output

No response

BioPhoton avatar Apr 09 '24 23:04 BioPhoton