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

misc: generate snapshot/timespan reports from sample flow result #13937

Merged
merged 3 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions build/build-sample-reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ const flowResult = readJson(
`${LH_ROOT}/lighthouse-core/test/fixtures/fraggle-rock/reports/sample-flow-result.json`
);

/** @type {LH.Result} */
const snapshotLhr = readJson(
`${LH_ROOT}/lighthouse-core/test/fixtures/fraggle-rock/reports/sample-snapshot-lhr.json`
);
const snapshotLhr = flowResult.steps.find(step => step.lhr.gatherMode === 'snapshot')?.lhr;
const timespanLhr = flowResult.steps.find(step => step.lhr.gatherMode === 'timespan')?.lhr;
if (!snapshotLhr) throw new Error('Could not find a snapshot report on the sample flow result');
if (!timespanLhr) throw new Error('Could not find a timespan report on the sample flow result');

const DIST = path.join(LH_ROOT, 'dist');

Expand All @@ -42,6 +42,7 @@ const DIST = path.join(LH_ROOT, 'dist');
'error': errorLhr,
'single-category': tweakLhrForPsi(lhr),
'snapshot': snapshotLhr,
'timespan': timespanLhr,
};

// Generate and write reports
Expand Down
35 changes: 0 additions & 35 deletions lighthouse-core/scripts/update-snapshot-sample.js

This file was deleted.

2,468 changes: 0 additions & 2,468 deletions lighthouse-core/test/fixtures/fraggle-rock/reports/sample-snapshot-lhr.json

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"i18n:collect-strings": "node lighthouse-core/scripts/i18n/collect-strings.js",
"update:lantern-baseline": "node lighthouse-core/scripts/lantern/update-baseline-lantern-values.js",
"update:sample-artifacts": "node lighthouse-core/scripts/update-report-fixtures.js",
"update:sample-json": "yarn i18n:collect-strings && node ./lighthouse-cli -A=./lighthouse-core/test/results/artifacts --config-path=./lighthouse-core/test/results/sample-config.js --output=json --output-path=./lighthouse-core/test/results/sample_v2.json && node lighthouse-core/scripts/cleanup-LHR-for-diff.js ./lighthouse-core/test/results/sample_v2.json --only-remove-timing",
adamraine marked this conversation as resolved.
Show resolved Hide resolved
"update:flow-sample-json": "yarn i18n:collect-strings && node ./lighthouse-core/scripts/update-flow-fixtures.js",
"update:snapshot-sample-json": "node ./lighthouse-core/scripts/update-snapshot-sample.js",
"update:test-devtools": "bash lighthouse-core/test/chromium-web-tests/test-locally.sh --reset-results",
Expand Down