static void Process(string path, SearchOptions options, SearchRange range, ActionType action, IEnumerable <ParsedCommit> commitsToIgnore) { IEnumerable <CommitInfo> commits = CommitFinder.Parse(path, range); Explain.Print($"Found {commits.Count ()} commits."); switch (action) { case ActionType.ListConsideredCommits: PrintCommits(commits); return; case ActionType.ListBugs: var parsedCommits = CommitParser.Parse(commits, options).ToList(); var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options, commitsToIgnore); PrintBugs(bugCollection, options); if (options.ValidateBugStatus) { BugValidator.Validate(bugCollection, options); } return; default: throw new InvalidOperationException($"Internal Error - Unknown action requested {action}"); } }
public void BugCollector_SmokeTest() { var options = new SearchOptions() { Bugzilla = BugzillaLevel.Private }; var range = new SearchRange { Oldest = "98fff31".Some(), Newest = "6c280ad".Some() }; var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); var parsedCommits = CommitParser.Parse(commits, options).ToList(); var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options); Assert.AreEqual(2, bugCollection.Bugs.Count); Assert.AreEqual(3, bugCollection.PotentialBugs.Count); }
public void BugCollector_HandlesDuplicateBugEntries() { // One commit with certain, one without. Only one copy in final output var options = new SearchOptions() { Bugzilla = BugzillaLevel.Private }; var range = new SearchRange { Oldest = "ad26139".Some(), Newest = "6c280ad".Some() }; var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); var parsedCommits = CommitParser.Parse(commits, options).ToList(); var bugCollection = BugCollector.ClassifyCommits(parsedCommits, new SearchOptions()); Assert.AreEqual(1, bugCollection.Bugs.Count); Assert.AreEqual(0, bugCollection.PotentialBugs.Count); }