Skip to content

Commit 0e3e175

Browse files
authored
Allow tests to override GCP project id. (#276)
1 parent 796fb1b commit 0e3e175

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/metrics_center/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.0.8
2+
- Allow tests to override LegacyFlutterDestination GCP project id.
3+
14
# 0.0.7
25
- Expose constants that were missing since 0.0.4+1.
36

packages/metrics_center/lib/src/flutter.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@ class FlutterDestination extends MetricDestination {
4242
{bool isTesting = false}) async {
4343
// Specify the project id for LegacyFlutterDestination as we may get a
4444
// service account json from another GCP project.
45+
//
46+
// When we're testing, let projectId be null so we'll still use the test
47+
// project specified by the credentials json.
48+
//
49+
// This is completed, but fortunately we'll be able to remove all this
50+
// once the migration is fully done.
4551
final LegacyFlutterDestination legacyDestination =
4652
await LegacyFlutterDestination.makeFromCredentialsJson(json,
47-
projectId: 'flutter-cirrus');
53+
projectId: isTesting ? null : 'flutter-cirrus');
4854
final SkiaPerfDestination skiaPerfDestination =
4955
await SkiaPerfDestination.makeFromGcpCredentials(json,
5056
isTesting: isTesting);

0 commit comments

Comments
 (0)