def testIterateThroughResultsForUserIgnoreGroupByTags(self): """Tests that everything appears to function with ignore and grouping.""" self._input_mock.return_value = (None, None) expectations.IterateThroughResultsForUser(self.result_map, True) expected_contents = validate_tag_consistency.TAG_HEADER + """\ [ win ] some_test [ Failure ] [ mac ] some_test [ Failure ] [ android ] some_test [ Failure ] """ with open(self.expectation_file) as infile: self.assertEqual(infile.read(), expected_contents)
def testIterateThroughResultsForUserFailNoGroupByTags(self): """Tests that everything appears to function with failure and no group.""" self._input_mock.return_value = ('Failure', 'crbug.com/1') expectations.IterateThroughResultsForUser(self.result_map, False) expected_contents = validate_tag_consistency.TAG_HEADER + """\ [ win ] some_test [ Failure ] [ mac ] some_test [ Failure ] [ android ] some_test [ Failure ] crbug.com/1 [ win ] foo_test [ Failure ] crbug.com/1 [ mac ] foo_test [ Failure ] crbug.com/1 [ win ] bar_test [ Failure ] """ with open(self.expectation_file) as infile: self.assertEqual(infile.read(), expected_contents)
def main(): args = ParseArgs() results = queries.GetFlakyOrFailingTests(args.sample_period, args.project) aggregated_results = results_module.AggregateResults(results) result_output.GenerateHtmlOutputFile(aggregated_results) print( 'If there are many instances of failed tests, that may be indicative ' 'of an issue that should be handled in some other way, e.g. reverting ' 'a bad CL.') input('\nBeginning of user input section - press any key to continue') expectations.IterateThroughResultsForUser(aggregated_results, args.group_by_tags) print( '\nGenerated expectations likely contain conflicting tags that need to ' 'be removed.')