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

cli: use fraggle rock runner by default, deprecate legacy navigation runner #13860

Merged
merged 7 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/recipes/custom-gatherer-puppeteer/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Make sure we're in this `docs/recipes/customer-gatherer-puppeteer` directory
cd "$(dirname "$0")"

node node_modules/.bin/lighthouse --config-path=custom-config.js https://www.example.com --output=json |
node node_modules/.bin/lighthouse --legacy-navigation --config-path=custom-config.js https://www.example.com --output=json |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recipe won't work in FR because it uses driver.wsEndpoint() which doesn't exist on the FR driver. We could add the function, or instead we could add a driver.getPage so users can easily get the correct puppeteer page to use.

That will be done in a separate PR as part of our docs updates.

jq '.audits["custom-audit"].score' |
grep -q 1
4 changes: 2 additions & 2 deletions lighthouse-cli/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ function getFlags(manualArgv, options = {}) {
type: 'boolean',
describe: 'Pause after page load to wait for permission to continue the run, evaluate `continueLighthouseRun` in the console to continue.',
},
'fraggle-rock': {
'legacy-navigation': {
type: 'boolean',
default: false,
describe: '[EXPERIMENTAL] Use the new Fraggle Rock navigation runner to gather results.',
describe: '[DEPRECATED] Use the legacy navigation runner to gather results. Only use this if you are using a pre-10.0 custom Lighthouse config, or if Lighthouse unexpectedly fails after updating to 10.0. Please file a bug if you need this flag for Lighthouse to work.',
},
'additional-trace-categories': {
type: 'string',
Expand Down
11 changes: 6 additions & 5 deletions lighthouse-cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,16 @@ async function runLighthouse(url, flags, config) {
flags.port = launchedChrome.port;
}

if (flags.fraggleRock) {
flags.channel = 'fraggle-rock-cli';
if (flags.legacyNavigation) {
log.warn('CLI', 'Legacy navigation CLI is deprecated');
flags.channel = 'legacy-navigation-cli';
} else {
flags.channel = 'cli';
}

const runnerResult = flags.fraggleRock ?
await lighthouse(url, flags, config) :
await lighthouse.legacyNavigation(url, flags, config);
const runnerResult = flags.legacyNavigation ?
await lighthouse.legacyNavigation(url, flags, config) :
await lighthouse(url, flags, config);

// If in gatherMode only, there will be no runnerResult.
if (runnerResult) {
Expand Down
40 changes: 20 additions & 20 deletions lighthouse-cli/test/cli/__snapshots__/cli-flags-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Object {
"--enabled-features=NetworkService,VirtualTime",
],
"chromeIgnoreDefaultFlags": false,
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -57,9 +57,9 @@ Object {
"chrome-ignore-default-flags": false,
"chromeFlags": "",
"chromeIgnoreDefaultFlags": false,
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -115,9 +115,9 @@ Object {
"extraHeaders": Object {
"foo": "bar",
},
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -157,9 +157,9 @@ Object {
"Cookie": "monster=blue",
"x-men": "wolverine",
},
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -191,9 +191,9 @@ Object {
"chrome-ignore-default-flags": false,
"chromeFlags": "",
"chromeIgnoreDefaultFlags": false,
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -239,9 +239,9 @@ Object {
"chrome-ignore-default-flags": false,
"chromeFlags": "",
"chromeIgnoreDefaultFlags": false,
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -287,9 +287,9 @@ Object {
"chrome-ignore-default-flags": false,
"chromeFlags": "",
"chromeIgnoreDefaultFlags": false,
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -335,9 +335,9 @@ Object {
"chrome-ignore-default-flags": false,
"chromeFlags": "",
"chromeIgnoreDefaultFlags": false,
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -390,9 +390,9 @@ Object {
"chromeIgnoreDefaultFlags": false,
"cli-flags-path": "__REPLACED__/lighthouse-cli/test/fixtures/cli-flags-path-inline-budgets.json",
"cliFlagsPath": "__REPLACED__/lighthouse-cli/test/fixtures/cli-flags-path-inline-budgets.json",
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down Expand Up @@ -436,9 +436,9 @@ Object {
"extraHeaders": Object {
"X-Men": "wolverine",
},
"fraggle-rock": false,
"fraggleRock": false,
"hostname": "127.0.0.1",
"legacy-navigation": false,
"legacyNavigation": false,
"list-all-audits": false,
"list-locales": false,
"list-trace-categories": false,
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/cli/bin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ beforeEach(async () => {
view: false,
verbose: false,
quiet: false,
fraggleRock: false,
legacyNavigation: false,
port: 0,
hostname: '',
// Command modes
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ async function internalRun(url, tmpPath, configJson, options) {
];

if (useFraggleRock) {
args.push('--fraggle-rock');
configJson = convertToFraggleRockConfig(configJson);
} else {
args.push('--legacy-navigation');
}

// Config can be optionally provided.
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ lighthouse.generateConfig = generateConfig;
lighthouse.getAuditList = Runner.getAuditList;
lighthouse.traceCategories = require('./gather/driver.js').traceCategories;
lighthouse.Audit = require('./audits/audit.js');
lighthouse.Gatherer = require('./gather/gatherers/gatherer.js');
lighthouse.Gatherer = require('./fraggle-rock/gather/base-gatherer.js');

// Explicit type reference (hidden by makeComputedArtifact) for d.ts export.
// TODO(esmodules): should be a workaround for module.export and can be removed when in esm.
Expand Down
Loading