def _line_from_test_and_flaky_types(self, test_path, flaky_types): line = TestExpectationLine() line.original_string = test_path line.name = test_path line.filename = test_path line.path = test_path # FIXME: Should this be normpath? line.matching_tests = [test_path] line.bugs = ["crbug.com/FILE_A_BUG_BEFORE_COMMITTING_THIS"] line.expectations = sorted(flaky_types) line.specifiers = self.specifiers return line
def _line_from_test_and_flaky_types_and_bug_urls(self, test_path, flaky_types, bug_urls): line = TestExpectationLine() line.original_string = test_path line.name = test_path line.filename = test_path line.path = test_path # FIXME: Should this be normpath? line.matching_tests = [test_path] line.bugs = bug_urls if bug_urls else ["Bug(gardener)"] line.expectations = sorted(map(self.results_json.expectation_for_type, flaky_types)) line.specifiers = self.specifiers return line
def _create_expectation_line(self, result, test_configuration): test_name = result.test_name() line = TestExpectationLine() line.name = test_name line.path = test_name line.matching_tests = [test_name] line.filename = '' if self._args.bug: line.bugs = ['crbug.com/%s' % self._args.bug] else: line.bugs = ['Bug(none)'] line.expectations = result.actual_results().split() line.parsed_expectations = [ TestExpectations.expectation_from_string(expectation) for expectation in line.expectations] line.specifiers = [test_configuration.version] line.matching_configurations = set([test_configuration]) return line