From de273e972df016e151bdea211b764b1b61e28217 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Wed, 24 Jun 2020 16:45:13 -0700 Subject: [PATCH] tests: move proto roundtrip json to .tmp/ (#10995) --- .gitignore | 1 - lighthouse-core/test/test-utils.js | 2 +- package.json | 2 +- proto/scripts/json_roundtrip_via_proto.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fcb84b7c64d9..49faa9e06801 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,3 @@ proto/scripts/*_processed.json # require any lock file to be checked in explicitly yarn.lock -proto/sample_v2_round_trip.json diff --git a/lighthouse-core/test/test-utils.js b/lighthouse-core/test/test-utils.js index ff2d29d66f82..d4c7f94f0e57 100644 --- a/lighthouse-core/test/test-utils.js +++ b/lighthouse-core/test/test-utils.js @@ -57,7 +57,7 @@ function getProtoRoundTrip() { let itIfProtoExists; try { sampleResultsRoundtripStr = - fs.readFileSync(__dirname + '/../../proto/sample_v2_round_trip.json', 'utf-8'); + fs.readFileSync(__dirname + '/../../.tmp/sample_v2_round_trip.json', 'utf-8'); describeIfProtoExists = describe; itIfProtoExists = it; } catch (err) { diff --git a/package.json b/package.json index 15ba5e896181..f2f89023415a 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "ultradumbBenchmark": "./lighthouse-core/scripts/benchmark.js", "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 --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", + "build-proto-roundtrip": "mkdir -p ./tmp && cd proto/scripts && PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 python json_roundtrip_via_proto.py", "static-server": "node lighthouse-cli/test/fixtures/static-server.js" }, "devDependencies": { diff --git a/proto/scripts/json_roundtrip_via_proto.py b/proto/scripts/json_roundtrip_via_proto.py index a70b8f485c4b..4527be08aec3 100644 --- a/proto/scripts/json_roundtrip_via_proto.py +++ b/proto/scripts/json_roundtrip_via_proto.py @@ -10,7 +10,7 @@ path_sample_preprocessed = path_dir + '/sample_v2_processed.json' path_sample = path_dir + '/../../lighthouse-core/test/results/sample_v2.json' -path_round_trip = path_dir + '/../sample_v2_round_trip.json' +path_round_trip = path_dir + '/../../.tmp/sample_v2_round_trip.json' def clean(): try: