[builder] Fix test race condition, cleanup tests

Two tests were using the same temporary document, so changed the
document path in one of them. Clean up imports in the tests.

Change-Id: I9cdb38db66705b081576da51484ccd65d7240632
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/219081
Reviewed-by: Jonas Termansen <sortie@google.com>
diff --git a/builder/test/commits_cache_test.dart b/builder/test/commits_cache_test.dart
index 1d4e5e3..cf3ba3c 100644
--- a/builder/test/commits_cache_test.dart
+++ b/builder/test/commits_cache_test.dart
@@ -7,8 +7,8 @@
 import 'package:http/http.dart' as http;
 import 'package:test/test.dart';
 
-import '../lib/src/firestore.dart' as fs;
-import '../lib/src/commits_cache.dart';
+import 'package:builder/src/firestore.dart' as fs;
+import 'package:builder/src/commits_cache.dart';
 
 // These tests read and write data from the Firestore database.
 // If they are run against the production database, they will not
diff --git a/builder/test/firestore_test.dart b/builder/test/firestore_test.dart
index 8003c70..f35a79c 100644
--- a/builder/test/firestore_test.dart
+++ b/builder/test/firestore_test.dart
@@ -2,11 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// import 'package:firebase_admin_interop/firebase_admin_interop.dart';
-// import 'package:firebase_functions_interop/firebase_functions_interop.dart';
 import 'package:builder/src/firestore.dart';
 import 'package:test/test.dart';
-import 'package:builder/src/tryjob.dart';
 import 'package:googleapis_auth/auth_io.dart';
 import 'package:http/http.dart' as http;
 import 'package:googleapis/firestore/v1.dart';
@@ -19,7 +16,6 @@
 // to point to a json key to a service account
 // with write access to dart_ci_staging datastore.
 // Set the database with 'firebase use --add dart-ci-staging'
-// The test must be compiled with nodejs, and run using the 'node' command.
 
 void main() async {
   final baseClient = http.Client();
diff --git a/builder/test/revert_test.dart b/builder/test/revert_test.dart
index 7090714..eee859d 100644
--- a/builder/test/revert_test.dart
+++ b/builder/test/revert_test.dart
@@ -4,7 +4,6 @@
 
 // Tests that check automatic approval of failures on a revert on the CI
 
-import 'package:builder/src/firestore.dart';
 import 'package:mockito/mockito.dart';
 import 'package:test/test.dart';
 
diff --git a/builder/test/tryjob_test.dart b/builder/test/tryjob_test.dart
index 3768a89..d264fd0 100644
--- a/builder/test/tryjob_test.dart
+++ b/builder/test/tryjob_test.dart
@@ -2,17 +2,16 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'package:builder/src/commits_cache.dart';
 import 'package:builder/src/firestore.dart';
+import 'package:builder/src/tryjob.dart';
 import 'package:googleapis/firestore/v1.dart';
+import 'package:googleapis_auth/auth_io.dart';
+import 'package:http/http.dart' as http;
 import 'package:mockito/mockito.dart';
 import 'package:test/test.dart';
 
-import 'package:builder/src/firestore.dart' as fs;
-import 'package:builder/src/commits_cache.dart';
-import 'package:builder/src/tryjob.dart';
 import 'fakes.dart';
-import 'package:googleapis_auth/auth_io.dart';
-import 'package:http/http.dart' as http;
 
 // These tests read and write data from the staging Firestore database.
 // They create a fake review, and fake try builds against that review.
@@ -21,9 +20,8 @@
 // to point to a json key to a service account.
 // To run against the staging database, use a service account.
 // with write access to dart_ci_staging datastore.
-// The test must be compiled with nodejs, and run using the 'node' command.
 
-const fakeReview = 123;
+const fakeReview = 172;
 const buildBaseCommit = 69191;
 const buildBaseCommitHash = 'b681bfd8d275b84b51f37919f0edc0d8563a870f';
 const buildBuildbucketId = 'a fake buildbucket ID';
@@ -55,7 +53,7 @@
   fakeTests.add(change['name']);
 }
 
-fs.FirestoreService firestore;
+FirestoreService firestore;
 http.Client client;
 CommitsCache commitsCache;