misc(proto): require protobuf 3.7.1, add stricter audit details test (#8867)

This commit is contained in:
Brendan Kenny 2019-05-05 16:52:22 -07:00 коммит произвёл Paul Irish
Родитель 6846807c4d
Коммит 24fe98250b
2 изменённых файлов: 5 добавлений и 18 удалений

Просмотреть файл

@ -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": {