Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: pkg/analysis_server/test/stress/utilities/git.dart

Issue 2611593002: Rework the replay test to be more correct (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/stress/utilities/git.dart
diff --git a/pkg/analysis_server/test/stress/utilities/git.dart b/pkg/analysis_server/test/stress/utilities/git.dart
index 32c7e9b281cf56846519527a91136513b1963ea4..cfcef4fb7aad2a13880f8f6e4f3f28cf21e7ee67 100644
--- a/pkg/analysis_server/test/stress/utilities/git.dart
+++ b/pkg/analysis_server/test/stress/utilities/git.dart
@@ -5,14 +5,14 @@
/**
* Support for interacting with a git repository.
*/
-library analysis_server.test.stress.utilities.git;
-
import 'dart:convert';
import 'dart:io';
import 'package:analyzer/src/util/glob.dart';
import 'package:path/path.dart' as path;
+import 'logger.dart';
+
/**
* A representation of the differences between two blobs.
*/
@@ -395,10 +395,18 @@ class GitRepository {
final String path;
/**
+ * The logger to which git commands should be written, or `null` if the
+ * commands should not be written.
+ */
+ final Logger logger;
+
+ /**
* Initialize a newly created repository to represent the git repository at
* the given [path].
+ *
+ * If a [commandSink] is provided, any calls to git will be written to it.
*/
- GitRepository(this.path);
+ GitRepository(this.path, {this.logger = null});
/**
* Checkout the given [commit] from the repository. This is done by running
@@ -454,6 +462,7 @@ class GitRepository {
* the result of running the process.
*/
ProcessResult _run(List<String> arguments) {
+ logger?.log('git', 'git', arguments: arguments);
return Process.runSync('git', arguments,
stderrEncoding: UTF8, stdoutEncoding: UTF8, workingDirectory: path);
}
« no previous file with comments | « pkg/analysis_server/test/stress/replay/replay.dart ('k') | pkg/analysis_server/test/stress/utilities/logger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698