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

Many new assertion errors giving score 0 #994

Open
villelahdenvuo opened this issue Dec 18, 2023 · 6 comments
Open

Many new assertion errors giving score 0 #994

villelahdenvuo opened this issue Dec 18, 2023 · 6 comments

Comments

@villelahdenvuo
Copy link

villelahdenvuo commented Dec 18, 2023

Describe the bug
I haven't changed my assertions and I haven't made any drastic changes to our code and suddenly I get many assertion failures in my tests even though according to the report they are okay.

To Reproduce

  1. Run Lighthouse with preset: lighthouse:no-pwa
  2. npx --yes --package=@lhci/cli@latest -- lhci autorun

Expected behavior
Passed asserts

Logs/Screenshots
Screenshot 2023-12-18 at 14 40 52
Note: Unused javascript has been changed from the preset and it used to pass.
This is the report generated which shows the assets should pass.
Screenshot 2023-12-18 at 14 42 50
Here's the exact same config/code running on 0.12:
Screenshot 2023-12-18 at 15 14 49

Environment (please complete the following information):

  • OS: Linux
  • Browser Chrome
  • Version 11.4.0
@chrismcmacken
Copy link

Same issue in my project

@connorjclark
Copy link
Collaborator

connorjclark commented Dec 19, 2023

Lighthouse 11.2 changed how many audits are scored to be based directly on the estimated metric savings. These audits are an example of that.

GoogleChrome/lighthouse#15447
https://github.com/GoogleChrome/lighthouse/pull/15447/files#diff-e65b7054d7252727360d6dfd95b8d36f87da23cd3f9b28a794aaf5d3720e866fR312
etc.

It was not considered how this change would effect LHCI. We'll need to discuss internally how to address this. Given the time of year, this likely won't be solved until after the new year. In the meantime, a few options for you:

  • you can update your assertions to use something other than score, like numericValue
  • stick to the previous LHCI for now
  • force LHCI to use Lighthouse 11.1 or prior

@villelahdenvuo
Copy link
Author

Thanks for the details! I'll stick to 0.12.0 for now and keep an eye on this issue to see how to move forward.

@xavierfoucrier
Copy link

Same on my side!
Thanks for highlighting this in a dedicated issue.

Waiting for the next version @connorjclark 😎

@davidlj95
Copy link

Just in case someone's looking for a workaround for now for total-byte-weight using a numeric value as mentioned above:

{
  "ci": {
    "assert": {
      "assertions": {
        "total-byte-weight": ["error", {"maxNumericValue": 1677721600}]
      }
    }
  }
}

This ensures total byte size of requested resources stays under 1,600 KiB as docs recommend

@villelahdenvuo
Copy link
Author

This workaround works for us, maybe it's sufficient to document that you can change the asserts like this if needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants