GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.39k stars 9.38k forks source link

[Programmatic Lighthouse] Performance category only run for some url #12887

Closed josecolella closed 3 years ago

josecolella commented 3 years ago

FAQ

URL

https://gusto.com

What happened?

I ran the lighthouse package with the following config:

{
    extends: 'lighthouse:default',
    settings: {
      onlyCategories: ['performance', 'seo'],
      throttlingMethod: 'provided',
      budgets
 }

and I'm wondering why I'm only seeing SEO tests, and not seeing performance

`Running test https://gusto.com/tools/salary-paycheck-calculator-iowa?utm_source=lighthouse_test

Reporting to DataDog lighthouse_8.score = 1 [screen:desktop,page:tools_salary_paycheckcalculator{state},category:seo,group:control] `

What did you expect?

I expected to see performance category being run

What have you tried?

I have tried to specifically state performance as a category in the config.json

How were you running Lighthouse?

node

Lighthouse Version

8.2.0

Chrome Version

No response

Node Version

v14.17.4

Relevant log output

No response

connorjclark commented 3 years ago
lighthouse https://www.example.com --view --only-categories=seo,performance

works fine for me. Are you sure the issue isn't with the way you send data to DataDog? It'd help if you provided the LHR json of the LH run.

josecolella commented 3 years ago

@connorjclark I can provide the json. I'm using the programmatic way of running lighthouse. Is the config.json that I've provided correct?

josecolella commented 3 years ago

I was able to fix the issue by using the following config

const desktopConfiguration = require('lighthouse/lighthouse-core/config/desktop-config.js');
const mobileConfiguration = require('lighthouse/lighthouse-core/config/lr-mobile-config.js');

and doing

desktopConfiguration.settings = {...desktopConfiguration.settings, ...{onlyCategories: ['performance', 'seo']}}