Changeset 120348 in webkit
- Timestamp:
- Jun 14, 2012 12:40:06 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r120342 r120348 1 2012-06-14 Dirk Pranke <dpranke@chromium.org> 2 3 NRWT should honor --skipped=[default|ignore|only], like ORWT does 4 https://bugs.webkit.org/show_bug.cgi?id=66308 5 6 Reviewed by Ryosuke Niwa. 7 8 This patch adds support for ORWT's --skipped=(default|ignore|only) 9 flag and cleans up the interaction between that and --ignore. 10 11 Individual tests (but not directories) explicitly listed on the 12 command line will always be run regardless of what is passed 13 for --skipped and --ignore. 14 15 This patch also changes the "found" and "running" log messages 16 since it wasn't clear how the skipped tests were included in those numbers. 17 18 * Scripts/webkitpy/layout_tests/controllers/manager.py: 19 (Manager.__init__): 20 (Manager.collect_tests): 21 (Manager.prepare_lists_and_print_output): 22 * Scripts/webkitpy/layout_tests/port/test.py: 23 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 24 (_set_up_derived_options): 25 (parse_args): 26 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 27 (MainTest.test_ignore_flag): 28 (MainTest): 29 (MainTest.test_skipped_flag): 30 1 31 2012-06-14 Takashi Toyoshima <toyoshim@chromium.org> 2 32 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
r119017 r120348 317 317 # a set of test files, and the same tests as a list 318 318 319 self._paths = set() 320 319 321 # FIXME: Rename to test_names. 320 322 self._test_files = set() … … 341 343 if self._options.test_list: 342 344 paths += self._strip_test_dir_prefixes(read_test_files(self._filesystem, self._options.test_list, self._port.TEST_PATH_SEPARATOR)) 345 self._paths = set(paths) 343 346 self._test_files = self._port.tests(paths) 344 347 … … 457 460 # Remove skipped - both fixable and ignored - files from the 458 461 # top-level list of files to test. 462 found_test_files = set(self._test_files) 459 463 num_all_test_files = len(self._test_files) 460 self._printer.print_expected("Found: %d tests" % (len(self._test_files))) 464 465 skipped = self._expectations.get_tests_with_result_type(test_expectations.SKIP) 466 if not self._options.http: 467 skipped.update(set(self._http_tests())) 468 469 if self._options.skipped == 'only': 470 self._test_files = self._test_files.intersection(skipped) 471 elif self._options.skipped == 'default': 472 self._test_files -= skipped 473 elif self._options.skipped == 'ignore': 474 pass # just to be clear that we're ignoring the skip list. 475 476 if self._options.skip_failing_tests: 477 self._test_files -= self._expectations.get_tests_with_result_type(test_expectations.FAIL) 478 self._test_files -= self._expectations.get_tests_with_result_type(test_expectations.FLAKY) 479 480 # now make sure we're explicitly running any tests passed on the command line. 481 self._test_files.update(found_test_files.intersection(self._paths)) 482 461 483 if not num_all_test_files: 462 484 _log.critical('No tests to run.') 463 485 return None 464 486 465 skipped = set() 466 467 if not self._options.http: 468 skipped = skipped.union(self._http_tests()) 469 470 if num_all_test_files > 1 and not self._options.force: 471 skipped.update(self._expectations.get_tests_with_result_type(test_expectations.SKIP)) 472 if self._options.skip_failing_tests: 473 skipped.update(self._expectations.get_tests_with_result_type(test_expectations.FAIL)) 474 skipped.update(self._expectations.get_tests_with_result_type(test_expectations.FLAKY)) 475 476 self._test_files -= skipped 487 num_skipped = num_all_test_files - len(self._test_files) 488 if num_skipped: 489 self._printer.print_expected("Running %s (found %d, skipping %d)." % ( 490 grammar.pluralize('test', num_all_test_files - num_skipped), 491 num_all_test_files, num_skipped)) 492 elif len(self._test_files) > 1: 493 self._printer.print_expected("Running all %d tests." % len(self._test_files)) 494 else: 495 self._printer.print_expected("Running %1 test.") 477 496 478 497 # Create a sorted list of test files so the subset chunk, … … 505 524 self._print_expected_results_of_type(result_summary, test_expectations.SKIP, "skipped") 506 525 507 if self._options.force: 508 self._printer.print_expected('Running all tests, including skips (--force)') 509 else: 526 if self._options.skipped != 'ignore': 510 527 # Note that we don't actually run the skipped tests (they were 511 528 # subtracted out of self._test_files, above), but we stub out the -
trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py
r119520 r120348 175 175 expected_checksum=None, 176 176 expected_image='tEXtchecksum\x00checksum_in_image-checksum') 177 tests.add('passes/skipped/skip.html') 177 178 178 179 # Note that here the checksums don't match but the images do, so this test passes "unexpectedly". … … 264 265 WONTFIX SKIP : failures/expected/keyboard.html = CRASH 265 266 WONTFIX SKIP : failures/expected/exception.html = CRASH 267 WONTFIX SKIP : passes/skipped/skip.html = PASS 266 268 """) 267 269 -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r120007 r120348 158 158 options.additional_platform_directory = normalized_platform_directories 159 159 160 if not options.http and options. force:161 warnings.append("-- no-http is ignored since --force is also provided")160 if not options.http and options.skipped in ('ignore', 'only'): 161 warnings.append("--force/--skipped=%s overrides --no-http." % (options.skipped)) 162 162 options.http = True 163 163 … … 348 348 "DumpRenderTree; option is split on whitespace before " 349 349 "running. (Example: --wrapper='valgrind --smc-check=all')"), 350 # old-run-webkit-tests:351 # -i|--ignore-tests Comma-separated list of directories352 # or tests to ignore353 350 optparse.make_option("-i", "--ignore-tests", action="append", default=[], 354 351 help="directories or test to ignore (may specify multiple times)"), 355 352 optparse.make_option("--test-list", action="append", 356 353 help="read list of tests to run from file", metavar="FILE"), 357 # old-run-webkit-tests uses --skipped==[default|ignore|only]358 # instead of --force:359 optparse.make_option("--force", action="store_true", default=False,360 help="Run all tests, even those marked SKIP in the test list "),354 optparse.make_option("--skipped", action="store", default="default", 355 help="control how tests marked SKIP are run. 'default' == Skip, 'ignore' == Run them anyway, 'only' == only run the SKIP tests."), 356 optparse.make_option("--force", dest="skipped", action="store_const", const='ignore', 357 help="Run all tests, even those marked SKIP in the test list (same as --skipped=ignore)"), 361 358 optparse.make_option("--time-out-ms", 362 359 help="Set the timeout for each test"), -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r120240 r120348 402 402 self.assertEquals(tests_run, ['passes/image.html', 'passes/text.html']) 403 403 404 def test_ignore_tests(self): 405 def assert_ignored(args, tests_expected_to_run): 406 tests_to_run = ['failures/expected/image.html', 'passes/image.html'] 407 tests_run = get_tests_run(args + tests_to_run, tests_included=True, flatten_batches=True) 408 self.assertEquals(tests_run, tests_expected_to_run) 409 410 assert_ignored(['-i', 'failures/expected/image.html'], ['passes/image.html']) 411 assert_ignored(['-i', 'passes'], ['failures/expected/image.html']) 412 413 # Note here that there is an expectation for failures/expected/image.html already, but 414 # it is overriden by the command line arg. This might be counter-intuitive. 415 # FIXME: This isn't currently working ... 416 # assert_ignored(['-i', 'failures/expected'], ['passes/image.html']) 404 def test_ignore_flag(self): 405 # Note that passes/image.html is expected to be run since we specified it directly. 406 tests_run = get_tests_run(['-i', 'passes', 'passes/image.html'], flatten_batches=True, tests_included=True) 407 self.assertFalse('passes/text.html' in tests_run) 408 self.assertTrue('passes/image.html' in tests_run) 409 410 def test_skipped_flag(self): 411 tests_run = get_tests_run(['passes'], tests_included=True, flatten_batches=True) 412 self.assertFalse('passes/skipped/skip.html' in tests_run) 413 num_tests_run_by_default = len(tests_run) 414 415 # Check that nothing changes when we specify skipped=default. 416 self.assertEquals(len(get_tests_run(['--skipped=default', 'passes'], tests_included=True, flatten_batches=True)), 417 num_tests_run_by_default) 418 419 # Now check that we run one more test (the skipped one). 420 tests_run = get_tests_run(['--skipped=ignore', 'passes'], tests_included=True, flatten_batches=True) 421 self.assertTrue('passes/skipped/skip.html' in tests_run) 422 self.assertEquals(len(tests_run), num_tests_run_by_default + 1) 423 424 # Now check that we only run the skipped test. 425 self.assertEquals(get_tests_run(['--skipped=only', 'passes'], tests_included=True, flatten_batches=True), 426 ['passes/skipped/skip.html']) 417 427 418 428 def test_iterations(self):
Note: See TracChangeset
for help on using the changeset viewer.