core: fix sample_v2 generation, proto errors (#8605)
This commit is contained in:
Родитель
b2abbe7426
Коммит
0d1faf7057
|
@ -25,7 +25,12 @@ async function update() {
|
|||
}));
|
||||
|
||||
const url = `http://localhost:${port}/dobetterweb/dbw_tester.html`;
|
||||
const flags = cliFlags.getFlags(`--gather-mode=lighthouse-core/test/results/artifacts ${url}`);
|
||||
const rawFlags = [
|
||||
'--gather-mode=lighthouse-core/test/results/artifacts',
|
||||
'--throttling-method=devtools',
|
||||
url,
|
||||
].join(' ');
|
||||
const flags = cliFlags.getFlags(rawFlags);
|
||||
await cli.runLighthouse(url, flags, undefined);
|
||||
await new Promise(res => server.close(res));
|
||||
}
|
||||
|
|
|
@ -45,12 +45,19 @@ describe('round trip JSON comparison subsets', () => {
|
|||
});
|
||||
|
||||
it('has the same top level values', () => {
|
||||
// Don't test all top level properties that are objects.
|
||||
Object.keys(sampleJson).forEach(audit => {
|
||||
if (typeof sampleJson[audit] === 'object' && !Array.isArray(sampleJson[audit])) {
|
||||
delete sampleJson[audit];
|
||||
}
|
||||
});
|
||||
|
||||
// Properties set to their type's default value will be omitted in the roundTripJson.
|
||||
// For an explicit list of properties, remove sampleJson values if set to a default.
|
||||
if (Array.isArray(sampleJson.stackPacks) && sampleJson.stackPacks.length === 0) {
|
||||
delete sampleJson.stackPacks;
|
||||
}
|
||||
|
||||
expect(roundTripJson).toMatchObject(sampleJson);
|
||||
});
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
"type-check": "tsc -p . && tsc -p lighthouse-viewer/",
|
||||
"i18n:checks": "./lighthouse-core/scripts/i18n/assert-strings-collected.sh",
|
||||
"i18n:collect-strings": "node lighthouse-core/scripts/i18n/collect-strings.js",
|
||||
"update:sample-artifacts": "node lighthouse-core/scripts/update-report-fixtures.js -G",
|
||||
"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 --throttling-method=devtools --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 && yarn compile-proto && yarn build-proto-roundtrip",
|
||||
"diff:sample-json": "yarn i18n:checks && bash lighthouse-core/scripts/assert-golden-lhr-unchanged.sh",
|
||||
"ultradumbBenchmark": "./lighthouse-core/scripts/benchmark.js",
|
||||
|
|
|
@ -161,6 +161,9 @@ message LighthouseResult {
|
|||
string entry_type = 2;
|
||||
google.protobuf.DoubleValue start_time = 3;
|
||||
google.protobuf.DoubleValue duration = 4;
|
||||
|
||||
// Whether timing entry was collected during artifact gathering.
|
||||
bool gather = 5;
|
||||
}
|
||||
|
||||
// The total duration of Lighthouse's run
|
||||
|
|
|
@ -3652,11 +3652,10 @@
|
|||
"warningAuditsGroupTitle": "Passed audits but with warnings",
|
||||
"warningHeader": "Warnings: "
|
||||
}
|
||||
},
|
||||
},
|
||||
"lighthouseVersion": "4.3.0",
|
||||
"requestedUrl": "http://localhost:10200/dobetterweb/dbw_tester.html",
|
||||
"runWarnings": [],
|
||||
"stackPacks": [],
|
||||
"runWarnings": [],
|
||||
"timing": {
|
||||
"entries": [
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ declare global {
|
|||
/** The record of all formatted string locations in the LHR and their corresponding source values. */
|
||||
i18n: {rendererFormattedStrings: I18NRendererStrings, icuMessagePaths: I18NMessages};
|
||||
/** An array containing the result of all stack packs. */
|
||||
stackPacks: Result.StackPack[];
|
||||
stackPacks?: Result.StackPack[];
|
||||
}
|
||||
|
||||
// Result namespace
|
||||
|
|
Загрузка…
Ссылка в новой задаче