Changeset 87593 in webkit
- Timestamp:
- May 27, 2011 7:11:00 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r87592 r87593 8 8 9 9 * Scripts/webkitpy/common/config/committers.py: 10 11 2011-05-27 Dirk Pranke <dpranke@chromium.org> 12 13 Reviewed by Adam Barth. 14 15 NRWT: remove --print detailed-progress 16 https://bugs.webkit.org/show_bug.cgi?id=60324 17 18 * Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py: 19 * Scripts/webkitpy/layout_tests/layout_package/printing.py: 20 * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py: 21 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 10 22 11 23 2011-05-27 Dirk Pranke <dpranke@chromium.org> -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py
r87591 r87593 330 330 # if this will be an issue in practice. 331 331 printer = printing.Printer(port_obj, options, sys.stderr, sys.stdout, 332 int(options.child_processes), options.experimental_fully_parallel,333 332 configure_logging) 334 333 self._client.run(port_obj) -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py
r87591 r87593 58 58 default include the default options. This is useful for logging 59 59 the default options plus additional settings. 60 everything print everything (except the trace-* options and the61 detailed-progress option,see below for the full list )60 everything print (almost) everything (except the trace-* options, 61 see below for the full list ) 62 62 misc print miscellaneous things like blank lines 63 63 … … 68 68 69 69 During the run: 70 detailed-progress print one dot per test completed71 70 one-line-progress print a one-line progress bar 72 71 unexpected print any unexpected results as they occur … … 89 88 90 89 Notes: 91 - 'detailed-progress' can only be used if running in a single thread92 (using --child-processes=1) or a single queue of tests (using93 --experimental-fully-parallel). If these conditions aren't true,94 'one-line-progress' will be used instead.95 - If both 'detailed-progress' and 'one-line-progress' are specified (and96 both are possible), 'detailed-progress' will be used.97 90 - If 'nothing' is specified, it overrides all of the other options. 98 91 - Specifying --verbose is equivalent to --print everything plus it … … 126 119 127 120 128 def parse_print_options(print_options, verbose, child_processes, 129 is_fully_parallel): 121 def parse_print_options(print_options, verbose): 130 122 """Parse the options provided to --print and dedup and rank them. 131 123 … … 144 136 return set() 145 137 146 if (child_processes != 1 and not is_fully_parallel and147 'detailed-progress' in switches):148 _log.warn("Can only print 'detailed-progress' if running "149 "with --child-processes=1 or "150 "with --experimental-fully-parallel. "151 "Using 'one-line-progress' instead.")152 switches.discard('detailed-progress')153 switches.add('one-line-progress')154 155 138 if 'everything' in switches: 156 139 switches.discard('everything') … … 161 144 switches.update(set(PRINT_DEFAULT.split(','))) 162 145 163 if 'detailed-progress' in switches:164 switches.discard('one-line-progress')165 166 146 if 'trace-everything' in switches: 167 switches.discard('detailed-progress')168 147 switches.discard('one-line-progress') 169 148 switches.discard('trace-unexpected') … … 211 190 output gets logged to stderr.""" 212 191 def __init__(self, port, options, regular_output, buildbot_output, 213 c hild_processes, is_fully_parallel, configure_logging):192 configure_logging): 214 193 """ 215 194 Args … … 220 199 buildbot_output stream to which output intended to be read by 221 200 the buildbots (and humans) should be written 222 child_processes number of parallel threads running (usually223 controlled by --child-processes)224 is_fully_parallel are the tests running in a single queue, or225 in shards (usually controlled by226 --experimental-fully-parallel)227 201 configure_loggign Whether a logging handler should be registered 228 202 229 Note that the fourth and fifth args are separate rather than bundled into230 the options structure so that this object does not assume any flags231 set in options that weren't returned from logging_options(), above.232 The two are used to determine whether or not we can sensibly use233 the 'detailed-progress' option, or can only use 'one-line-progress'.234 203 """ 235 204 self._buildbot_stream = buildbot_output … … 238 207 self._stream = regular_output 239 208 240 # These are used for --print detailed-progress to track status by241 # directory.242 self._current_dir = None243 self._current_progress_str = ""244 self._current_test_number = 0245 246 209 self._meter = metered_stream.MeteredStream(options.verbose, 247 210 regular_output) … … 251 214 252 215 self.switches = parse_print_options(options.print_options, 253 options.verbose , child_processes, is_fully_parallel)216 options.verbose) 254 217 255 218 def cleanup(self): … … 335 298 self.enabled('trace-unexpected') and not expected): 336 299 self._print_test_trace(result, exp_str, got_str) 337 elif (not expected and self.enabled('unexpected') and 338 self.disabled('detailed-progress')): 339 # Note: 'detailed-progress' handles unexpected results internally, 340 # so we skip it here. 300 elif not expected and self.enabled('unexpected'): 341 301 self._print_unexpected_test_result(result) 342 302 … … 378 338 def print_progress(self, result_summary, retrying, test_list): 379 339 """Print progress through the tests as determined by --print.""" 380 if self.enabled('detailed-progress'): 381 self._print_detailed_progress(result_summary, test_list) 382 elif self.enabled('one-line-progress'): 340 if self.enabled('one-line-progress'): 383 341 self._print_one_line_progress(result_summary, retrying) 384 342 else: … … 398 356 " %d left" % (action, percent_complete, result_summary.expected, 399 357 result_summary.unexpected, result_summary.remaining)) 400 401 def _print_detailed_progress(self, result_summary, test_list):402 """Display detailed progress output where we print the directory name403 and one dot for each completed test. This is triggered by404 "--log detailed-progress"."""405 if self._current_test_number == len(test_list):406 return407 408 next_test = test_list[self._current_test_number]409 next_dir = self._port._filesystem.dirname(410 self._port.relative_test_filename(next_test))411 if self._current_progress_str == "":412 self._current_progress_str = "%s: " % (next_dir)413 self._current_dir = next_dir414 415 while next_test in result_summary.results:416 if next_dir != self._current_dir:417 self._meter.write("%s\n" % (self._current_progress_str))418 self._current_progress_str = "%s: ." % (next_dir)419 self._current_dir = next_dir420 else:421 self._current_progress_str += "."422 423 if (next_test in result_summary.unexpected_results and424 self.enabled('unexpected')):425 self._meter.write("%s\n" % self._current_progress_str)426 test_result = result_summary.results[next_test]427 self._print_unexpected_test_result(test_result)428 self._current_progress_str = "%s: " % self._current_dir429 430 self._current_test_number += 1431 if self._current_test_number == len(test_list):432 break433 434 next_test = test_list[self._current_test_number]435 next_dir = self._port._filesystem.dirname(436 self._port.relative_test_filename(next_test))437 438 if result_summary.remaining:439 remain_str = " (%d)" % (result_summary.remaining)440 self._meter.progress("%s%s" % (self._current_progress_str,441 remain_str))442 else:443 self._meter.progress("%s" % (self._current_progress_str))444 358 445 359 def print_unexpected_results(self, unexpected_results): -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
r87591 r87593 78 78 79 79 def test_parse_print_options(self): 80 def test_switches(args, expected_switches_str, 81 verbose=False, child_processes=1, 82 is_fully_parallel=False): 80 def test_switches(args, expected_switches_str, verbose=False): 83 81 options, args = get_options(args) 84 82 if expected_switches_str: … … 87 85 expected_switches = set() 88 86 switches = printing.parse_print_options(options.print_options, 89 verbose, 90 child_processes, 91 is_fully_parallel) 87 verbose) 92 88 self.assertEqual(expected_switches, switches) 93 89 … … 113 109 114 110 class Testprinter(unittest.TestCase): 115 def get_printer(self, args=None, single_threaded=False, 116 is_fully_parallel=False): 111 def get_printer(self, args=None): 117 112 args = args or [] 118 113 printing_options = printing.print_options() … … 121 116 self._port = port.get('test', options) 122 117 nproc = 2 123 if single_threaded:124 nproc = 1125 118 126 119 regular_output = array_stream.ArrayStream() 127 120 buildbot_output = array_stream.ArrayStream() 128 121 printer = printing.Printer(self._port, options, regular_output, 129 buildbot_output, single_threaded, 130 is_fully_parallel, 131 configure_logging=True) 122 buildbot_output, configure_logging=True) 132 123 return printer, regular_output, buildbot_output 133 124 … … 356 347 self.assertFalse(err.empty()) 357 348 358 err.reset()359 out.reset()360 printer.print_progress(rs, True, paths)361 self.assertFalse(err.empty())362 self.assertTrue(out.empty())363 364 def test_print_progress__detailed(self):365 tests = ['passes/text.html', 'failures/expected/timeout.html',366 'failures/expected/crash.html']367 expectations = 'BUGX : failures/expected/timeout.html = TIMEOUT'368 369 # first, test that it is disabled properly370 # should still print one-line-progress371 printer, err, out = self.get_printer(372 ['--print', 'detailed-progress'], single_threaded=False)373 paths, rs, exp = self.get_result_summary(tests, expectations)374 printer.print_progress(rs, False, paths)375 self.assertFalse(err.empty())376 self.assertTrue(out.empty())377 378 # now test the enabled paths379 printer, err, out = self.get_printer(380 ['--print', 'detailed-progress'], single_threaded=True)381 paths, rs, exp = self.get_result_summary(tests, expectations)382 printer.print_progress(rs, False, paths)383 self.assertFalse(err.empty())384 self.assertTrue(out.empty())385 386 err.reset()387 out.reset()388 printer.print_progress(rs, True, paths)389 self.assertFalse(err.empty())390 self.assertTrue(out.empty())391 392 rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), False)393 rs.add(self.get_result('failures/expected/timeout.html'), True)394 rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), True)395 err.reset()396 out.reset()397 printer.print_progress(rs, False, paths)398 self.assertFalse(err.empty())399 self.assertTrue(out.empty())400 401 # We only clear the meter when retrying w/ detailed-progress.402 err.reset()403 out.reset()404 printer.print_progress(rs, True, paths)405 self.assertFalse(err.empty())406 self.assertTrue(out.empty())407 408 printer, err, out = self.get_printer(409 ['--print', 'detailed-progress,unexpected'], single_threaded=True)410 paths, rs, exp = self.get_result_summary(tests, expectations)411 printer.print_progress(rs, False, paths)412 self.assertFalse(err.empty())413 self.assertTrue(out.empty())414 415 err.reset()416 out.reset()417 printer.print_progress(rs, True, paths)418 self.assertFalse(err.empty())419 self.assertTrue(out.empty())420 421 rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), False)422 rs.add(self.get_result('failures/expected/timeout.html'), True)423 rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), True)424 err.reset()425 out.reset()426 printer.print_progress(rs, False, paths)427 self.assertFalse(err.empty())428 self.assertTrue(out.empty())429 430 # We only clear the meter when retrying w/ detailed-progress.431 349 err.reset() 432 350 out.reset() -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r87591 r87593 73 73 74 74 printer = printing.Printer(port, options, regular_output, buildbot_output, 75 int(options.child_processes), options.experimental_fully_parallel, 76 configure_logging=True) 75 configure_logging=True) 77 76 for w in warnings: 78 77 _log.warning(w)
Note: See TracChangeset
for help on using the changeset viewer.