Changeset 136769 in webkit
- Timestamp:
- Dec 5, 2012, 3:26:24 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r136768 r136769 1 2012-12-05 Dirk Pranke <dpranke@chromium.org> 2 3 nrwt: collect all of the information about a run into a new RunDetails class 4 https://bugs.webkit.org/show_bug.cgi?id=104158 5 6 Reviewed by Ojan Vafai. 7 8 This patch collects the information from both test passes (the 9 main one and the retries) as well as the summarized results and 10 the exit code into a RunDetails class, so that the integration 11 tests can more easily tell what happened. 12 13 Also, change the way the --lint-test-files works slightly so that 14 we don't need to create a printer object (and hence we need to 15 rework the tests that are testing logging). 16 17 * Scripts/webkitpy/layout_tests/controllers/manager.py: 18 (RunDetails): 19 (RunDetails.__init__): 20 (Manager.run): 21 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 22 (run): 23 (main): 24 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 25 (passing_run): 26 (run_and_capture): 27 (LintTest.test_lint_test_files): 28 (LintTest.test_lint_test_files__errors): 29 (MainTest.test_verbose_in_child_processes): 30 1 31 2012-12-05 Dirk Pranke <dpranke@chromium.org> 2 32 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
r136768 r136769 57 57 58 58 59 class RunDetails(object): 60 def __init__(self, exit_code, summarized_results=None, result_summary=None, retry_summary=None): 61 self.exit_code = exit_code 62 self.summarized_results = summarized_results 63 self.result_summary = result_summary 64 self.retry_summary = retry_summary 65 66 59 67 def interpret_test_failures(failures): 60 68 test_dict = {} … … 332 340 333 341 def run(self, args): 334 """Run all our tests on all our test files and return the number of unexpected results (0 == success)."""342 """Run the tests and return a RunDetails object with the results.""" 335 343 self._printer.write_update("Collecting tests ...") 336 344 try: … … 338 346 except IOError: 339 347 # This is raised if --test-list doesn't exist 340 return -1348 return RunDetails(exit_code=-1) 341 349 342 350 self._printer.write_update("Parsing expectations ...") … … 349 357 if not tests_to_run: 350 358 _log.critical('No tests to run.') 351 return -1359 return RunDetails(exit_code=-1) 352 360 353 361 if not self._set_up_run(tests_to_run): 354 return -1362 return RunDetails(exit_code=-1) 355 363 356 364 start_time = time.time() … … 392 400 self._port.show_results_html_file(results_path) 393 401 394 return self._port.exit_code_from_summarized_results(summarized_results) 402 return RunDetails(self._port.exit_code_from_summarized_results(summarized_results), 403 summarized_results, result_summary, retry_summary) 395 404 396 405 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, num_workers, retrying): -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r136768 r136769 92 92 93 93 _set_up_derived_options(port, options) 94 95 if options.lint_test_files:96 return lint(port, options)97 98 94 manager = Manager(port, options, printer) 99 95 printer.print_config(port.results_directory()) 100 96 101 unexpected_result_count= manager.run(args)102 _log.debug("Testing completed, Exit status: %d" % unexpected_result_count)103 return unexpected_result_count97 run_details = manager.run(args) 98 _log.debug("Testing completed, Exit status: %d" % run_details.exit_code) 99 return run_details 104 100 finally: 105 101 printer.cleanup() 102 106 103 107 104 def _set_up_derived_options(port, options): … … 420 417 logging.getLogger().setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO) 421 418 try: 422 return run(port, options, args) 419 if options.lint_test_files: 420 return lint(port, options) 421 return run(port, options, args).exit_code 423 422 except Exception, e: 424 423 print >> sys.stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r136768 r136769 89 89 buildbot_output = StringIO.StringIO() 90 90 regular_output = StringIO.StringIO() 91 r es = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, regular_output=regular_output)92 return r es== 091 run_details = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, regular_output=regular_output) 92 return run_details.exit_code == 0 93 93 94 94 … … 113 113 buildbot_output = StringIO.StringIO() 114 114 regular_output = StringIO.StringIO() 115 r es = run_webkit_tests.run(port_obj, options, parsed_args,116 buildbot_output=buildbot_output,117 regular_output=regular_output)115 run_details = run_webkit_tests.run(port_obj, options, parsed_args, 116 buildbot_output=buildbot_output, 117 regular_output=regular_output) 118 118 finally: 119 119 oc.restore_output() 120 return (r es, buildbot_output, regular_output)120 return (run_details.exit_code, buildbot_output, regular_output) 121 121 122 122 … … 246 246 247 247 def test_lint_test_files(self): 248 res, out, err, user = logging_run(['--lint-test-files']) 248 oc = outputcapture.OutputCapture() 249 oc.capture_output() 250 try: 251 res = run_webkit_tests.main(['--platform', 'test', '--lint-test-files']) 252 finally: 253 out, err, logs = oc.restore_output() 254 249 255 self.assertEqual(res, 0) 250 self.assertEmpty(out) 251 self.assertContains(err, 'Lint succeeded') 256 self.assertEqual(out, '') 257 self.assertEqual(err, '') 258 self.assertTrue('Lint succeeded' in logs) 252 259 253 260 def test_lint_test_files__errors(self): 254 options, parsed_args = parse_args(['-- lint-test-files'])261 options, parsed_args = parse_args(['--platform', 'test', '--lint-test-files']) 255 262 host = MockHost() 256 263 port_obj = host.port_factory.get(options.platform, options=options) 257 264 port_obj.expectations_dict = lambda: {'': '-- syntax error'} 258 res, out, err = run_and_capture(port_obj, options, parsed_args) 265 266 oc = outputcapture.OutputCapture() 267 oc.capture_output() 268 try: 269 res = run_webkit_tests.lint(port_obj, options) 270 finally: 271 out, err, logs = oc.restore_output() 259 272 260 273 self.assertEqual(res, -1) 261 self.assertEmpty(out) 262 self.assertTrue(any(['Lint failed' in msg for msg in err.buflist])) 274 self.assertEqual(out, '') 275 self.assertEqual(err, '') 276 self.assertTrue('Lint failed' in logs) 263 277 264 278 # ensure we lint *all* of the files in the cascade. 265 279 port_obj.expectations_dict = lambda: {'foo': '-- syntax error1', 'bar': '-- syntax error2'} 266 res, out, err = run_and_capture(port_obj, options, parsed_args) 280 oc.capture_output() 281 try: 282 res = run_webkit_tests.lint(port_obj, options) 283 finally: 284 out, err, logs = oc.restore_output() 267 285 268 286 self.assertEqual(res, -1) 269 self.assertEmpty(out) 270 self.assertTrue(any(['foo:1' in msg for msg in err.buflist])) 271 self.assertTrue(any(['bar:1' in msg for msg in err.buflist])) 287 self.assertEqual(out, '') 288 self.assertEqual(err, '') 289 self.assertTrue('foo:1' in logs) 290 self.assertTrue('bar:1' in logs) 272 291 273 292 … … 945 964 buildbot_output = StringIO.StringIO() 946 965 regular_output = StringIO.StringIO() 947 r es = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, regular_output=regular_output)966 run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, regular_output=regular_output) 948 967 self.assertTrue('text.html passed' in regular_output.getvalue()) 949 968 self.assertTrue('image.html passed' in regular_output.getvalue())
Note:
See TracChangeset
for help on using the changeset viewer.