5 instantiations of Cause
SelectTests (5)
TestSelector.cs (5)
203AddCause(testCauses, project, new Cause(CauseKind.Convention, file)); 215new Cause(CauseKind.PathRule, file, rule.Reason)); 264AddCause(testCauses, project, new Cause(CauseKind.Layer1Graph, project, Path: path)); 291new Cause(CauseKind.AffectedProject, matchedProject, rule.Reason)); 422new 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)
673static JsonArray ItemsWithCauses(IReadOnlySet<string> items, IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes) 681foreach (var cause in list.OrderBy(c => CausePriority(c.Kind))) 830var groups = new Dictionary<string, Dictionary<string, Cause>>(StringComparer.Ordinal); 838foreach (var cause in causes) 843members = new Dictionary<string, Cause>(StringComparer.Ordinal); 849if (!members.TryGetValue(project, out var existing) || CausePriority(cause.Kind) < CausePriority(existing.Kind)) 936private static string MemberWithHops(KeyValuePair<string, Cause> member) 954private static string CauseGroupKey(Cause cause) => cause.Kind switch 1020private static string JobCausesText(IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes, string key) 1200IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes) 1209foreach (var cause in list.OrderBy(c => CausePriority(c.Kind))) 1267private static string ShortCause(Cause cause) => cause.Kind switch 1284private static string Layer1ShortCause(Cause cause) 1298private 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>(); 310foreach (var dotnetTestsCause in dotnetTestsCauses) 341private static readonly IReadOnlyDictionary<string, IReadOnlyList<Cause>> s_emptyCauses = 342new Dictionary<string, IReadOnlyList<Cause>>(StringComparer.Ordinal); 344private static IReadOnlyDictionary<string, IReadOnlyList<Cause>> Freeze(Dictionary<string, List<Cause>> causes) => 345causes.ToDictionary(kv => kv.Key, kv => (IReadOnlyList<Cause>)kv.Value, StringComparer.Ordinal); 359private static void AddCause(Dictionary<string, List<Cause>> causes, string key, Cause cause) 363list = new List<Cause>(); 395Dictionary<string, List<Cause>> testCauses, 396Dictionary<string, List<Cause>> jobCauses, 397List<Cause> dotnetTestsCauses, 434Dictionary<string, List<Cause>> testCauses, 435Dictionary<string, List<Cause>> jobCauses, 436List<Cause> dotnetTestsCauses, 439Cause cause) 460Dictionary<string, List<Cause>> testCauses, 461Dictionary<string, List<Cause>> jobCauses, 462List<Cause> dotnetTestsCauses, 465Cause cause,