89 references to Run
Infrastructure.Tests (89)
TestTriggerMap\GraphAffectedProjectsTests.cs (1)
475
private string Git(params string[] args) => GitCli.
Run
(_workspace.Path, args);
TestTriggerMap\PrComparisonBaseTests.cs (86)
33
GitCli.
Run
(workspace.Path, "clone", "--no-local", new Uri(repo).AbsoluteUri, checkout);
34
Assert.Equal("false", GitCli.
Run
(checkout, "rev-parse", "--is-shallow-repository"));
42
Assert.Equal(merge, GitCli.
Run
(checkout, "rev-parse", "HEAD"));
61
expectedMerge = GitCli.
Run
(workspace.Path, "rev-parse", $"{head}^");
62
GitCli.
Run
(workspace.Path, "checkout", "--detach", expectedMerge);
66
expectedMerge = GitCli.
Run
(workspace.Path, "commit-tree", $"{merge}^{{tree}}",
68
GitCli.
Run
(workspace.Path, "checkout", "--detach", expectedMerge);
87
GitCli.
Run
(repo, "init", "-b", "main");
88
GitCli.
Run
(repo, "config", "user.email", "test@example.invalid");
89
GitCli.
Run
(repo, "config", "user.name", "Test");
92
GitCli.
Run
(repo, "add", ".");
93
GitCli.
Run
(repo, "commit", "-m", "Root");
94
var root = GitCli.
Run
(repo, "rev-parse", "HEAD");
100
GitCli.
Run
(repo, "commit", "-am", "Production change");
101
var commonAncestor = GitCli.
Run
(repo, "rev-parse", "HEAD");
102
GitCli.
Run
(repo, "branch", "topic");
106
GitCli.
Run
(repo, "checkout", "-b", $"{side}-side", root);
110
GitCli.
Run
(repo, "checkout", "main");
115
GitCli.
Run
(repo, "merge", "--no-ff", "main-side", "-m", "Merge main docs");
116
var currentBase = GitCli.
Run
(repo, "rev-parse", "HEAD");
117
GitCli.
Run
(repo, "checkout", "topic");
123
GitCli.
Run
(repo, "commit", "-am", "Revert production change");
124
GitCli.
Run
(repo, "merge", "--no-ff", "pr-side", "-m", "Merge PR docs");
125
var head = GitCli.
Run
(repo, "rev-parse", "HEAD");
126
GitCli.
Run
(repo, "checkout", "main");
127
GitCli.
Run
(repo, "merge", "--no-ff", "topic", "-m", "Synthetic merge");
128
var merge = GitCli.
Run
(repo, "rev-parse", "HEAD");
129
Assert.Equal(commonAncestor, GitCli.
Run
(repo, "merge-base", "--all", currentBase, head));
134
GitCli.
Run
(workspace.Path, "clone", "--depth=1", "--no-local", new Uri(repo).AbsoluteUri, checkout);
137
GitCli.
Run
(checkout, "fetch", "--no-tags", "--depth=4", "origin", currentBase, head);
138
Assert.Equal(root, GitCli.
Run
(checkout, "merge-base", currentBase, head));
147
Assert.Equal("true", GitCli.
Run
(checkout, "rev-parse", "--is-shallow-repository"));
149
GitCli.
Run
(checkout, "fetch", "--no-tags", "--unshallow", "origin");
159
Assert.Equal(commonAncestor, GitCli.
Run
(checkout, "merge-base", "--all", currentBase, head));
160
Assert.Equal("false", GitCli.
Run
(checkout, "rev-parse", "--is-shallow-repository"));
161
Assert.Equal(merge, GitCli.
Run
(checkout, "rev-parse", "HEAD"));
172
GitCli.
Run
(workspace.Path, "clone", "--depth=1", "--no-local", new Uri(repo).AbsoluteUri, checkout);
173
GitCli.
Run
(checkout, "remote", "remove", "origin");
180
Assert.Equal("true", GitCli.
Run
(checkout, "rev-parse", "--is-shallow-repository"));
189
GitCli.
Run
(repo, "init", "-b", "main");
190
GitCli.
Run
(repo, "config", "user.email", "test@example.invalid");
191
GitCli.
Run
(repo, "config", "user.name", "Test");
194
GitCli.
Run
(repo, "add", ".");
195
GitCli.
Run
(repo, "commit", "-m", "Root");
196
var root = GitCli.
Run
(repo, "rev-parse", "HEAD");
198
GitCli.
Run
(repo, "commit", "-am", "Production change");
199
var productionAncestor = GitCli.
Run
(repo, "rev-parse", "HEAD");
200
GitCli.
Run
(repo, "checkout", "-b", "topic", root);
204
GitCli.
Run
(repo, "merge", "--no-ff", "-s", "ours", productionAncestor, "-m", "Discard production change");
205
var head = GitCli.
Run
(repo, "rev-parse", "HEAD");
206
GitCli.
Run
(repo, "checkout", "main");
207
GitCli.
Run
(repo, "merge", "--no-ff", docsAncestor, "-m", "Merge docs");
208
var currentBase = GitCli.
Run
(repo, "rev-parse", "HEAD");
211
GitCli.
Run
(repo, "merge-base", "--all", currentBase, head).Split('\n').Order(StringComparer.Ordinal));
212
GitCli.
Run
(repo, "merge", "--no-ff", "-s", "ours", "topic", "-m", "Synthetic merge");
213
var merge = GitCli.
Run
(repo, "rev-parse", "HEAD");
227
GitCli.
Run
(workspace.Path, "checkout", "--detach", head);
242
GitCli.
Run
(workspace.Path, "checkout", "--orphan", "unrelated");
243
GitCli.
Run
(workspace.Path, "rm", "-rf", ".");
245
GitCli.
Run
(workspace.Path, "checkout", "main");
246
GitCli.
Run
(workspace.Path, "merge", "--no-ff", "--allow-unrelated-histories", "unrelated", "-m", "Synthetic merge");
247
var merge = GitCli.
Run
(workspace.Path, "rev-parse", "HEAD");
248
GitCli.
Run
(workspace.Path, "remote", "add", "origin", workspace.Path);
263
GitCli.
Run
(workspace.Path, "remote", "add", "origin", workspace.Path);
278
GitCli.
Run
(workspace.Path, "checkout", "topic");
279
GitCli.
Run
(workspace.Path, "mv", "root.txt", "renamed.txt");
280
GitCli.
Run
(workspace.Path, "commit", "-m", "Rename PR file");
281
var head = GitCli.
Run
(workspace.Path, "rev-parse", "HEAD");
282
GitCli.
Run
(workspace.Path, "checkout", "main");
283
GitCli.
Run
(workspace.Path, "merge", "--no-ff", "topic", "-m", "Synthetic merge");
284
var merge = GitCli.
Run
(workspace.Path, "rev-parse", "HEAD");
306
GitCli.
Run
(repo, "init", "-b", "main");
307
GitCli.
Run
(repo, "config", "user.email", "test@example.invalid");
308
GitCli.
Run
(repo, "config", "user.name", "Test");
310
GitCli.
Run
(repo, "checkout", "-b", "topic");
312
GitCli.
Run
(repo, "checkout", "main");
314
GitCli.
Run
(repo, "checkout", "topic");
317
GitCli.
Run
(repo, "merge", "--no-ff", "main", "-m", "Update topic");
319
var head = GitCli.
Run
(repo, "rev-parse", "HEAD");
320
GitCli.
Run
(repo, "checkout", "main");
321
GitCli.
Run
(repo, "merge", "--no-ff", "topic", "-m", "Synthetic merge");
323
return (oldBase, currentBase, head, GitCli.
Run
(repo, "rev-parse", "HEAD"));
329
GitCli.
Run
(repo, "add", "--", path);
330
GitCli.
Run
(repo, "commit", "-m", $"Add {path}");
332
return GitCli.
Run
(repo, "rev-parse", "HEAD");
336
=> GitCli.
Run
(repo, "diff", "--name-only", "--no-renames", $"{from}...{to}")
TestTriggerMap\SelectTestsCliTests.cs (1)
1441
private static string RunGit(string repoRoot, params string[] args) => GitCli.
Run
(repoRoot, args);
TestTriggerMap\SelectTestsLayer1IntegrationTests.cs (1)
402
public string Git(params string[] args) => GitCli.
Run
(_workspace.Path, args);