OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 for test in self._expectations: | 1167 for test in self._expectations: |
1168 if test.name and test.name in tests_to_skip: | 1168 if test.name and test.name in tests_to_skip: |
1169 test.warnings.append('%s:%s %s is also in a Skipped file.' % (te
st.filename, test.line_numbers, test.name)) | 1169 test.warnings.append('%s:%s %s is also in a Skipped file.' % (te
st.filename, test.line_numbers, test.name)) |
1170 | 1170 |
1171 model = TestExpectationsModel(self._shorten_filename) | 1171 model = TestExpectationsModel(self._shorten_filename) |
1172 for test_name in tests_to_skip: | 1172 for test_name in tests_to_skip: |
1173 expectation_line = self._parser.expectation_for_skipped_test(test_na
me) | 1173 expectation_line = self._parser.expectation_for_skipped_test(test_na
me) |
1174 model.add_expectation_line(expectation_line) | 1174 model.add_expectation_line(expectation_line) |
1175 self._model.merge_model(model) | 1175 self._model.merge_model(model) |
1176 | 1176 |
| 1177 def remove_tests(self, tests_to_remove): |
| 1178 for test in self._expectations: |
| 1179 if test.name and test.name in tests_to_remove: |
| 1180 self.remove_expectation_line(test) |
| 1181 |
1177 def add_expectations_from_bot(self): | 1182 def add_expectations_from_bot(self): |
1178 # FIXME: With mode 'very-flaky' and 'maybe-flaky', this will show the ex
pectations entry in the flakiness | 1183 # FIXME: With mode 'very-flaky' and 'maybe-flaky', this will show the ex
pectations entry in the flakiness |
1179 # dashboard rows for each test to be whatever the bot thinks they should
be. Is this a good thing? | 1184 # dashboard rows for each test to be whatever the bot thinks they should
be. Is this a good thing? |
1180 bot_expectations = self._port.bot_expectations() | 1185 bot_expectations = self._port.bot_expectations() |
1181 model = TestExpectationsModel(self._shorten_filename) | 1186 model = TestExpectationsModel(self._shorten_filename) |
1182 for test_name in bot_expectations: | 1187 for test_name in bot_expectations: |
1183 expectation_line = self._parser.expectation_line_for_test(test_name,
bot_expectations[test_name]) | 1188 expectation_line = self._parser.expectation_line_for_test(test_name,
bot_expectations[test_name]) |
1184 | 1189 |
1185 # Unexpected results are merged into existing expectations. | 1190 # Unexpected results are merged into existing expectations. |
1186 model.add_expectation_line(expectation_line) | 1191 model.add_expectation_line(expectation_line) |
(...skipping 15 matching lines...) Expand all Loading... |
1202 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1207 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
1203 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1208 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
1204 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1209 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
1205 return expectation_line.to_string(test_configuration_converter) | 1210 return expectation_line.to_string(test_configuration_converter) |
1206 return expectation_line.original_string | 1211 return expectation_line.original_string |
1207 | 1212 |
1208 def nones_out(expectation_line): | 1213 def nones_out(expectation_line): |
1209 return expectation_line is not None | 1214 return expectation_line is not None |
1210 | 1215 |
1211 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) | 1216 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) |
OLD | NEW |