Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do we inject the env IS_TESTING?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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