misc(proto): require protobuf 3.7.1, add stricter audit details test (#8867)
This commit is contained in:
Родитель
6846807c4d
Коммит
24fe98250b
|
@ -21,23 +21,10 @@ describe('round trip JSON comparison subsets', () => {
|
|||
sampleJson = JSON.parse(preprocessor.processForProto(sample));
|
||||
});
|
||||
|
||||
it('has the same audit results sans details', () => {
|
||||
Object.keys(sampleJson.audits).forEach(audit => {
|
||||
delete sampleJson.audits[audit].details;
|
||||
});
|
||||
|
||||
expect(roundTripJson.audits).toMatchObject(sampleJson.audits);
|
||||
});
|
||||
|
||||
it('has the same audit results & details if applicable', () => {
|
||||
Object.keys(sampleJson.audits).forEach(auditId => {
|
||||
expect(roundTripJson.audits[auditId]).toMatchObject(sampleJson.audits[auditId]);
|
||||
|
||||
if ('details' in sampleJson.audits[auditId]) {
|
||||
expect(roundTripJson.audits[auditId].details)
|
||||
.toMatchObject(sampleJson.audits[auditId].details);
|
||||
}
|
||||
});
|
||||
it('has the same audit results and details (if applicable)', () => {
|
||||
for (const auditId of Object.keys(sampleJson.audits)) {
|
||||
expect(roundTripJson.audits[auditId]).toEqual(sampleJson.audits[auditId]);
|
||||
}
|
||||
});
|
||||
|
||||
it('has the same i18n rendererFormattedStrings', () => {
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
"ultradumbBenchmark": "./lighthouse-core/scripts/benchmark.js",
|
||||
"mixed-content": "./lighthouse-cli/index.js --chrome-flags='--headless' --preset=mixed-content",
|
||||
"minify-latest-run": "./lighthouse-core/scripts/lantern/minify-trace.js ./latest-run/defaultPass.trace.json ./latest-run/defaultPass.trace.min.json && ./lighthouse-core/scripts/lantern/minify-devtoolslog.js ./latest-run/defaultPass.devtoolslog.json ./latest-run/defaultPass.devtoolslog.min.json",
|
||||
"compile-proto": "[ \"$(protoc --version)\" == 'libprotoc 3.6.1' ] && protoc --python_out=./ ./proto/lighthouse-result.proto && mv ./proto/*_pb2.py ./proto/scripts || (echo \"❌ Install protobuf to compile the proto file.\" && false)",
|
||||
"compile-proto": "protoc --python_out=./ ./proto/lighthouse-result.proto && mv ./proto/*_pb2.py ./proto/scripts || (echo \"❌ Install protobuf ≥ 3.7.1 to compile the proto file.\" && false)",
|
||||
"build-proto-roundtrip": "cd proto/scripts && PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 python json_roundtrip_via_proto.py"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Загрузка…
Ссылка в новой задаче