Currently if I set assertions and budgets together in lighthouserc, it will throw this error https://github.com/GoogleChrome/lighthouse-ci/blob/d050357f4cdacf5aa6cea22c36425b194612deb6/packages/cli/src/assert/assert.js#L48
So I have to create two config, one for budgets, one for assertions, and run the whole tests twice, which is very slow
I guess it is doable as I was able to run the test once in https://github.com/andreasonny83/lighthouse-ci
Thanks for filing! You can absolutely run assertions and budgets together, you just can't use both a budgetsFile and a lighthouserc file to configure your assertions for the same run since they would conflict with one another.
See the section in the assertions docs about configuring budgets inside your lighthouserc file.
FYI, you also don't need to run the entire pipeline twice in your current setup, you could run lhci autorun with your assertions and then just lhci assert --budgetsFile=./path/to/budget.json once it is done which should be very fast.
thank you very much! lhci autorun && lhci assert --no-lighthouserc --budgetsFile=budgets.json solved my issue
Most helpful comment
thank you very much!
lhci autorun && lhci assert --no-lighthouserc --budgetsFile=budgets.jsonsolved my issue