You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The -G and -A flags can be used to run the gathering and auditing phases separately in the CLI. We should add some way to run these phases separately in user flows.
Faster audit workflow: User flows can take arbitrarily long. Would be nice to test audit changes in flows using existing artifacts without running an entire user flow.
Deterministic sample updating: (TL;DR sample_v2.json for user flows) To rebaseline the sample flow report, we currently run an end-to-end user flow experience. This means normal page variance tends to bloat the size of the sample diff, making reviews of sample diffs hard and CI verification impossible. Separate gathering modes allow us to check-in an artifacts file and test how changes to the auditing phase affect the final flow result deterministically.
Less stalling in the middle of a flow: We could defer auditing for each step to the end of the entire flow. Small impact compared to running gatherers, but should come for free with these changes.
Thinking about making this a static function on Runner but open to suggestions here.
We won't handle the -G logic for user flows, but it's important that individual navigations respond to the -G flag to maintain parity when running Lighthouse CLI with the --fraggle-rock flag.
Move FR usage of Runner.run to user-flow.js and api.jscore(fr): separate audit phase for flows #13623
- Individual FR runners snapshot, startTimespan, navigation will return artifacts instead of a RunnerResult.
- Add wrapper functions that send returned artifacts through Runner.run() in api.js. Maintains the current API for individual runners.
- Artifacts will be saved on an instance of UserFlow. Auditing can be run as part of UserFlow.getFlowResult.
Add saveArtifacts and loadArtifacts functions to UserFlow
- Pass artifacts into the constructor?
Update sample flow JSON script runs audit mode on some checked-in artifacts.
The
-Gand-Aflags can be used to run the gathering and auditing phases separately in the CLI. We should add some way to run these phases separately in user flows.Previous discussion: #11623
Benefits of 2-stage User Flows
sample_v2.jsonfor user flows) To rebaseline the sample flow report, we currently run an end-to-end user flow experience. This means normal page variance tends to bloat the size of the sample diff, making reviews of sample diffs hard and CI verification impossible. Separate gathering modes allow us to check-in an artifacts file and test how changes to the auditing phase affect the final flow result deterministically.Implementation Plan
Create helper to handle gather phase core(runner): asset manager helper #13519
gatherArtifactsOrLoadFromFile()or somethingRunnerbut open to suggestions here.We won't handle the-Glogic for user flows, but it's important that individual navigations respond to the-Gflag to maintain parity when running Lighthouse CLI with the--fraggle-rockflag.Remove gathering phase from
Runner.run()core(runner): independent gather and audit functions #13569Current interface:
lighthouse/lighthouse-core/runner.js
Lines 30 to 36 in 68ba77a
Proposed interface:
Effectively turns
Runner.run()into and "audit runner".Call to function from step 1 lifted to
lighthouse-core/run.jsandnavigation runnerall FR runners. Results are passed toRunner.run().Timespan and snapshot runners would directly run whatever is in their.gatherFnand pass results as a param toRunnerRFC: core(runner): move non-audit code to index and gather-runner #12393
Move FR usage of
Runner.runtouser-flow.jsandapi.jscore(fr): separate audit phase for flows #13623- Individual FR runners
snapshot,startTimespan,navigationwill return artifacts instead of aRunnerResult.- Add wrapper functions that send returned artifacts through
Runner.run()inapi.js. Maintains the current API for individual runners.- Artifacts will be saved on an instance of
UserFlow. Auditing can be run as part ofUserFlow.getFlowResult.Add
saveArtifactsandloadArtifactsfunctions toUserFlow- Pass artifacts into the constructor?
Update sample flow JSON script runs audit mode on some checked-in artifacts.
Add CI check for sample flow JSON