Upgrade metrics_center to write into GCS buckets (flutter/engine#24022)
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,6 +24,7 @@ void main() {
|
||||
'example/txt_benchmarks.json',
|
||||
], environment: <String, String>{
|
||||
'BENCHMARK_GCP_CREDENTIALS': testCred,
|
||||
'IS_TESTING': 'true',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user