5 instantiations of Cause
SelectTests (5)
TestSelector.cs (5)
203AddCause(testCauses, project, new Cause(CauseKind.Convention, file)); 216new Cause(CauseKind.PathRule, file, rule.Reason)); 265AddCause(testCauses, project, new Cause(CauseKind.Layer1Graph, project, Path: path)); 292new Cause(CauseKind.AffectedProject, matchedProject, rule.Reason)); 423new Cause(CauseKind.DerivedFromTest, triggeringTest, derived.Reason));
51 references to Cause
Infrastructure.Tests (6)
TestTriggerMap\SelectTestsAcceptanceTests.cs (6)
498var cause = Assert.Single(r.TestCauses["InstallerTests"]); 508var cause = Assert.Single(r.TestCauses["Foo.Tests"]); 518var cause = Assert.Single(r.TestCauses["Layer1Only"]); 541var cause = Assert.Single(r.TestCauses["Layer1Only"]); 554var cause = Assert.Single(r.JobCauses["job:projjob"]); 567var cause = Assert.Single(r.JobCauses["job:cli-starter"]);
SelectTests (45)
Program.cs (14)
674static JsonArray ItemsWithCauses(IReadOnlySet<string> items, IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes) 682foreach (var cause in list.OrderBy(c => CausePriority(c.Kind))) 831var groups = new Dictionary<string, Dictionary<string, Cause>>(StringComparer.Ordinal); 839foreach (var cause in causes) 844members = new Dictionary<string, Cause>(StringComparer.Ordinal); 850if (!members.TryGetValue(project, out var existing) || CausePriority(cause.Kind) < CausePriority(existing.Kind)) 937private static string MemberWithHops(KeyValuePair<string, Cause> member) 955private static string CauseGroupKey(Cause cause) => cause.Kind switch 1021private static string JobCausesText(IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes, string key) 1201IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes) 1210foreach (var cause in list.OrderBy(c => CausePriority(c.Kind))) 1268private static string ShortCause(Cause cause) => cause.Kind switch 1285private static string Layer1ShortCause(Cause cause) 1299private static string VerboseCause(Cause cause)
TestSelector.cs (31)
29/// <summary>A changed file matched a <c>conventions</c> capture pattern (<see cref="Cause.Trigger"/> is the file).</summary> 32/// <summary>A changed file matched a <c>path_rules</c> glob (<see cref="Cause.Trigger"/> is the file; <see cref="Cause.Reason"/> is the rule's <c>reason</c>).</summary> 35/// <summary>An affected production/non-test project matched an <c>affected_project_rules</c> glob (<see cref="Cause.Trigger"/> is the project name).</summary> 38/// <summary>The Layer 1 MSBuild graph marked this test project affected by a changed source file (<see cref="Cause.Trigger"/> is the project name).</summary> 41/// <summary>A selected test project pulled this in via <c>derived_targets</c> (<see cref="Cause.Trigger"/> is the triggering test project).</summary> 96IReadOnlyDictionary<string, IReadOnlyList<Cause>> TestCauses, 97IReadOnlyDictionary<string, IReadOnlyList<Cause>> JobCauses); 170var testCauses = new Dictionary<string, List<Cause>>(StringComparer.Ordinal); 171var jobCauses = new Dictionary<string, List<Cause>>(StringComparer.Ordinal); 172var dotnetTestsCauses = new List<Cause>(); 311foreach (var dotnetTestsCause in dotnetTestsCauses) 342private static readonly IReadOnlyDictionary<string, IReadOnlyList<Cause>> s_emptyCauses = 343new Dictionary<string, IReadOnlyList<Cause>>(StringComparer.Ordinal); 345private static IReadOnlyDictionary<string, IReadOnlyList<Cause>> Freeze(Dictionary<string, List<Cause>> causes) => 346causes.ToDictionary(kv => kv.Key, kv => (IReadOnlyList<Cause>)kv.Value, StringComparer.Ordinal); 360private static void AddCause(Dictionary<string, List<Cause>> causes, string key, Cause cause) 364list = new List<Cause>(); 396Dictionary<string, List<Cause>> testCauses, 397Dictionary<string, List<Cause>> jobCauses, 398List<Cause> dotnetTestsCauses, 435Dictionary<string, List<Cause>> testCauses, 436Dictionary<string, List<Cause>> jobCauses, 437List<Cause> dotnetTestsCauses, 440Cause cause) 461Dictionary<string, List<Cause>> testCauses, 462Dictionary<string, List<Cause>> jobCauses, 463List<Cause> dotnetTestsCauses, 466Cause cause,