def execute(self, options, args, tool): if not args and not options.all: print "You must either specify one or more test paths or --all." return if options.platform: port_names = fnmatch.filter(tool.port_factory.all_port_names(), options.platform) if not port_names: default_port = tool.port_factory.get(options.platform) if default_port: port_names = [default_port.name()] else: print "No port names match '%s'" % options.platform return else: default_port = tool.port_factory.get(port_names[0]) else: default_port = tool.port_factory.get(options=options) port_names = [default_port.name()] serializer = TestExpectationSerializer() tests = default_port.tests(args) for port_name in port_names: model = self._model(options, port_name, tests) tests_to_print = self._filter_tests(options, model, tests) lines = [ model.get_expectation_line(test) for test in sorted(tests_to_print) ] if port_name != port_names[0]: print print '\n'.join( self._format_lines(options, port_name, serializer, lines))
def update_expectations(self, failure_info_list): expectation_lines = self._parser.parse( self._tool.filesystem.read_text_file( self._path_to_test_expectations_file)) editor = TestExpectationsEditor(expectation_lines, self) updated_expectation_lines = [] # FIXME: Group failures by testName+failureTypeList. for failure_info in failure_info_list: expectation_set = set( filter( lambda expectation: expectation is not None, map(TestExpectations.expectation_from_string, failure_info['failureTypeList']))) assert (expectation_set) test_name = failure_info['testName'] assert (test_name) builder_name = failure_info['builderName'] affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations( builder_name) updated_expectation_lines.extend( editor.update_expectation(test_name, affected_test_configuration_set, expectation_set)) self._tool.filesystem.write_text_file( self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string( expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines))
def update_expectations(self, failure_info_list): expectation_lines = self._parser.parse( self._tool.filesystem.read_text_file(self._path_to_test_expectations_file) ) editor = TestExpectationsEditor(expectation_lines, self) updated_expectation_lines = [] # FIXME: Group failures by testName+failureTypeList. for failure_info in failure_info_list: expectation_set = set( filter( lambda expectation: expectation is not None, map(TestExpectations.expectation_from_string, failure_info["failureTypeList"]), ) ) assert expectation_set test_name = failure_info["testName"] assert test_name builder_name = failure_info["builderName"] affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name) updated_expectation_lines.extend( editor.update_expectation(test_name, affected_test_configuration_set, expectation_set) ) self._tool.filesystem.write_text_file( self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string( expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines ), )
def execute(self, options, args, tool): port = factory.get("chromium-win-win7") # FIXME: This should be selectable. expectation_lines = TestExpectationParser.tokenize_list(port.test_expectations()) parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False) for expectation_line in expectation_lines: parser.parse(expectation_line) converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros()) tool.filesystem.write_text_file(port.path_to_test_expectations_file(), TestExpectationSerializer.list_to_string(expectation_lines, converter))
def execute(self, options, args, tool): port = tool.port_factory.get( "chromium-win-win7") # FIXME: This should be selectable. expectation_lines = TestExpectationParser.tokenize_list( port.test_expectations()) parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False) for expectation_line in expectation_lines: parser.parse(expectation_line) converter = TestConfigurationConverter( port.all_test_configurations(), port.configuration_specifier_macros()) tool.filesystem.write_text_file( port.path_to_test_expectations_file(), TestExpectationSerializer.list_to_string(expectation_lines, converter))