From 478675129c96e37b63471cfe3a9d6685d26a2a0c Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Fri, 29 Jan 2021 11:09:51 -0800 Subject: [PATCH] Upgrade metrics_center to write into GCS buckets (flutter/engine#24022) --- engine/src/flutter/testing/benchmark/bin/parse_and_send.dart | 3 +++ engine/src/flutter/testing/benchmark/pubspec.yaml | 2 +- .../flutter/testing/benchmark/test/parse_and_send_test.dart | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/testing/benchmark/bin/parse_and_send.dart b/engine/src/flutter/testing/benchmark/bin/parse_and_send.dart index 64af78eb26..55d8948a39 100644 --- a/engine/src/flutter/testing/benchmark/bin/parse_and_send.dart +++ b/engine/src/flutter/testing/benchmark/bin/parse_and_send.dart @@ -41,15 +41,18 @@ Future connectFlutterDestination() async { const String kTokenPath = 'TOKEN_PATH'; const String kGcpProject = 'GCP_PROJECT'; final Map env = Platform.environment; + final bool isTesting = env['IS_TESTING'] == 'true'; if (env.containsKey(kTokenPath) && env.containsKey(kGcpProject)) { return FlutterDestination.makeFromAccessToken( File(env[kTokenPath]).readAsStringSync(), env[kGcpProject], + isTesting: isTesting, ); } return await FlutterDestination.makeFromCredentialsJson( jsonDecode(Platform.environment['BENCHMARK_GCP_CREDENTIALS']) as Map, + isTesting: isTesting, ); } diff --git a/engine/src/flutter/testing/benchmark/pubspec.yaml b/engine/src/flutter/testing/benchmark/pubspec.yaml index 37e51ba42f..2f4e4d6492 100644 --- a/engine/src/flutter/testing/benchmark/pubspec.yaml +++ b/engine/src/flutter/testing/benchmark/pubspec.yaml @@ -3,7 +3,7 @@ name: flutter_engine_benchmark dependencies: git: any - metrics_center: 0.0.4 + metrics_center: 0.0.8 dev_dependencies: test: any diff --git a/engine/src/flutter/testing/benchmark/test/parse_and_send_test.dart b/engine/src/flutter/testing/benchmark/test/parse_and_send_test.dart index 6db1aded44..2e60118b98 100644 --- a/engine/src/flutter/testing/benchmark/test/parse_and_send_test.dart +++ b/engine/src/flutter/testing/benchmark/test/parse_and_send_test.dart @@ -24,6 +24,7 @@ void main() { 'example/txt_benchmarks.json', ], environment: { 'BENCHMARK_GCP_CREDENTIALS': testCred, + 'IS_TESTING': 'true', }); }); @@ -44,6 +45,7 @@ void main() { ], environment: { 'TOKEN_PATH': tokenPath, 'GCP_PROJECT': testCred['project_id'] as String, + 'IS_TESTING': 'true', }); expect(result.exitCode, 0); });