Skip to content

Commit

Permalink
Upgrade metrics_center to write into GCS buckets (flutter#24022)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyuqian authored Jan 29, 2021
1 parent 39f1bca commit 2a45e19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions testing/benchmark/bin/parse_and_send.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ Future<FlutterDestination> connectFlutterDestination() async {
const String kTokenPath = 'TOKEN_PATH';
const String kGcpProject = 'GCP_PROJECT';
final Map<String, String> 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<String, dynamic>,
isTesting: isTesting,
);
}

Expand Down
2 changes: 1 addition & 1 deletion testing/benchmark/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions testing/benchmark/test/parse_and_send_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void main() {
'example/txt_benchmarks.json',
], environment: <String, String>{
'BENCHMARK_GCP_CREDENTIALS': testCred,
'IS_TESTING': 'true',
});
});

Expand All @@ -44,6 +45,7 @@ void main() {
], environment: <String, String>{
'TOKEN_PATH': tokenPath,
'GCP_PROJECT': testCred['project_id'] as String,
'IS_TESTING': 'true',
});
expect(result.exitCode, 0);
});
Expand Down

0 comments on commit 2a45e19

Please sign in to comment.