Skip to content

Commit 7e83023

Browse files
committed
feat(cli): additive collect mode
1 parent e7a99ae commit 7e83023

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/cli/src/collect/collect.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const {saveLHR, clearSavedLHRs} = require('@lhci/utils/src/saved-reports.js');
1414
function buildCommand(yargs) {
1515
return yargs.options({
1616
method: {type: 'string', choices: ['node', 'docker'], default: 'node'},
17-
headful: {type: 'boolean', description: 'When enabled runs with a headful Chrome'},
17+
headful: {type: 'boolean', description: 'Run with a headful Chrome'},
18+
additive: {type: 'boolean', description: 'Skips clearing of previous collect data'},
1819
url: {description: 'The URL to run Lighthouse on.', required: true},
1920
settings: {description: 'The Lighthouse settings and flags to use when collecting'},
2021
numberOfRuns: {
@@ -34,7 +35,7 @@ async function runCommand(options) {
3435
if (options.method !== 'node') throw new Error(`Method "${options.method}" not yet supported`);
3536
const runner = new LighthouseRunner();
3637

37-
clearSavedLHRs();
38+
if (!options.additive) clearSavedLHRs();
3839
process.stdout.write(`Running Lighthouse ${options.numberOfRuns} time(s)\n`);
3940

4041
for (let i = 0; i < options.numberOfRuns; i++) {

packages/cli/src/upload/upload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function buildCommand(yargs) {
2828
description: 'sed-like replacement patterns to mask non-deterministic URL substrings.',
2929
default: [
3030
's#:[0-9]{3,5}/#:PORT/#', // replace ports
31-
's/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/i', // replace UUIDs
31+
's/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/ig', // replace UUIDs
3232
],
3333
},
3434
});

types/collect.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ declare global {
4343
method: 'node' | 'docker';
4444
numberOfRuns: number;
4545
headful: boolean;
46+
additive: boolean;
4647
settings?: LighthouseSettings;
4748
}
4849
}

0 commit comments

Comments
 (0)