Exemplo n.º 1
0
 def update_expectations(self, failure_info_list):
     expectation_lines = TestExpectationParser.tokenize_list(
         self._tool.filesystem.read_text_file(
             self._path_to_test_expectations_file))
     for expectation_line in expectation_lines:
         self._parser.parse(expectation_line)
     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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
 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))
 def update_expectations(self, failure_info_list):
     expectation_lines = TestExpectationParser.tokenize_list(self._tool.filesystem.read_text_file(self._path_to_test_expectations_file))
     for expectation_line in expectation_lines:
         self._parser.parse(expectation_line)
     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))