lighthouse-ci icon indicating copy to clipboard operation
lighthouse-ci copied to clipboard

Many new assertion errors giving score 0

Open villelahdenvuo opened this issue 1 year ago • 6 comments

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

villelahdenvuo avatar Dec 18 '23 13:12 villelahdenvuo

Same issue in my project

chrismcmacken avatar Dec 18 '23 19:12 chrismcmacken

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.

https://github.com/GoogleChrome/lighthouse/pull/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

connorjclark avatar Dec 19 '23 22:12 connorjclark

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.

villelahdenvuo avatar Dec 20 '23 09:12 villelahdenvuo

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

Waiting for the next version @connorjclark 😎

xavierfoucrier avatar Dec 20 '23 22:12 xavierfoucrier

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

davidlj95 avatar May 06 '24 16:05 davidlj95

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

villelahdenvuo avatar May 10 '24 15:05 villelahdenvuo

It seems to me like this is fixed now

nstringham avatar Jun 28 '24 04:06 nstringham

Yup, looks fixed for me 2 in 0.14

davidlj95 avatar Jun 28 '24 08:06 davidlj95