OLD | NEW |
1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 tests_to_skip.update(expectations.get_tests_with_result_type(test_ex
pectations.FLAKY)) | 102 tests_to_skip.update(expectations.get_tests_with_result_type(test_ex
pectations.FLAKY)) |
103 | 103 |
104 if self._options.skipped == 'only': | 104 if self._options.skipped == 'only': |
105 tests_to_skip = all_tests - tests_to_skip | 105 tests_to_skip = all_tests - tests_to_skip |
106 elif self._options.skipped == 'ignore': | 106 elif self._options.skipped == 'ignore': |
107 tests_to_skip = set() | 107 tests_to_skip = set() |
108 elif self._options.skipped != 'always': | 108 elif self._options.skipped != 'always': |
109 # make sure we're explicitly running any tests passed on the command
line; equivalent to 'default'. | 109 # make sure we're explicitly running any tests passed on the command
line; equivalent to 'default'. |
110 tests_to_skip -= set(paths) | 110 tests_to_skip -= set(paths) |
111 | 111 |
112 # unless of course we don't want to run the HTTP tests :) | |
113 if not self._options.http: | |
114 tests_to_skip.update(set(http_tests)) | |
115 | |
116 return tests_to_skip | 112 return tests_to_skip |
117 | 113 |
118 def split_into_chunks(self, test_names): | 114 def split_into_chunks(self, test_names): |
119 """split into a list to run and a set to skip, based on --run-chunk and
--run-part.""" | 115 """split into a list to run and a set to skip, based on --run-chunk and
--run-part.""" |
120 if not self._options.run_chunk and not self._options.run_part: | 116 if not self._options.run_chunk and not self._options.run_part: |
121 return test_names, set() | 117 return test_names, set() |
122 | 118 |
123 # If the user specifies they just want to run a subset of the tests, | 119 # If the user specifies they just want to run a subset of the tests, |
124 # just grab a subset of the non-skipped tests. | 120 # just grab a subset of the non-skipped tests. |
125 chunk_value = self._options.run_chunk or self._options.run_part | 121 chunk_value = self._options.run_chunk or self._options.run_part |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 _log.debug('chunk slice [%d:%d] of %d is %d tests' % (slice_start, slice
_end, num_tests, (slice_end - slice_start))) | 162 _log.debug('chunk slice [%d:%d] of %d is %d tests' % (slice_start, slice
_end, num_tests, (slice_end - slice_start))) |
167 | 163 |
168 # If we reached the end and we don't have enough tests, we run some | 164 # If we reached the end and we don't have enough tests, we run some |
169 # from the beginning. | 165 # from the beginning. |
170 if slice_end - slice_start < chunk_len: | 166 if slice_end - slice_start < chunk_len: |
171 extra = chunk_len - (slice_end - slice_start) | 167 extra = chunk_len - (slice_end - slice_start) |
172 _log.debug(' last chunk is partial, appending [0:%d]' % extra) | 168 _log.debug(' last chunk is partial, appending [0:%d]' % extra) |
173 tests_to_run.extend(test_names[0:extra]) | 169 tests_to_run.extend(test_names[0:extra]) |
174 | 170 |
175 return (tests_to_run, set(test_names) - set(tests_to_run)) | 171 return (tests_to_run, set(test_names) - set(tests_to_run)) |
OLD | NEW |