Changeset 129184 in webkit
- Timestamp:
- Sep 20, 2012 6:33:38 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r129181 r129184 1 2012-09-20 Dirk Pranke <dpranke@chromium.org> 2 3 make Skip, WontFix be the only expectations on a line 4 https://bugs.webkit.org/show_bug.cgi?id=97225 5 6 Reviewed by Ojan Vafai. 7 8 It is now incorrect in the new syntax to have a line like: 9 10 foo.html [ WontFix Crash ] 11 12 This will generate a lint warning and be treated as an invalid 13 line. Fixing this caused a whole bunch of unit tests to need updating 14 to no longer be marked as WontFix :). Also, this patch adjusts 15 the warnings so that missing Bug() identifiers will cause lint 16 warnings but will *not* cause the line to be treated as invalid. 17 Fixing these issues also revealed that test_hung_thread was no 18 longer testing the right logic, so I adjusted the timeouts in 19 test.py to make that test work again. 20 21 * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py: 22 (Worker._run_test_in_another_thread): 23 * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py: 24 (ResultSummaryTest.test_summarized_results_wontfix): 25 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 26 (TestExpectationParser._parse_modifiers): 27 (TestExpectationParser._tokenize_line_using_new_format): 28 (TestExpectationLine.is_invalid): 29 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: 30 (BasicTests.test_basic): 31 (test_get_test_set): 32 (test_parse_warning): 33 (test_pixel_tests_flag): 34 (SemanticTests.test_missing_bugid): 35 (SemanticTests): 36 (SemanticTests.test_skip_and_wontfix): 37 * Scripts/webkitpy/layout_tests/port/test.py: 38 (TestDriver.run_test): 39 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 40 (MainTest.test_hung_thread): 41 * Scripts/webkitpy/tool/commands/queries_unittest.py: 42 (PrintExpectationsTest.test_basic): 43 (PrintExpectationsTest.test_multiple): 44 (PrintExpectationsTest.test_full): 45 (PrintExpectationsTest.test_exclude): 46 (PrintExpectationsTest.test_csv): 47 1 48 2012-09-20 Lucas Forschler <lforschler@apple.com> 2 49 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
r125812 r129184 421 421 thread.join(thread_timeout_sec) 422 422 result = thread.result 423 failures = [] 423 424 if thread.isAlive(): 424 425 # If join() returned with the thread still running, the … … 431 432 # thread's results. 432 433 _log.error('Test thread hung: killing all DumpRenderTrees') 434 failures = [test_failures.FailureTimeout()] 433 435 434 436 driver.stop() 435 437 436 438 if not result: 437 result = test_results.TestResult(test_input.test_name, failures= [], test_run_time=0)439 result = test_results.TestResult(test_input.test_name, failures=failures, test_run_time=0) 438 440 return result 439 441 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
r129047 r129184 193 193 port._options.builder_name = 'dummy builder' 194 194 port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), "failures/expected/wontfix.html"), "Dummy test contents") 195 expected_results, unexpected_results = self.summarized_results(port, expected=False, passing=False, flaky=False, extra_tests=['failures/expected/wontfix.html'], extra_expectations='B UGX WONTFIX : failures/expected/wontfix.html = FAIL\n')195 expected_results, unexpected_results = self.summarized_results(port, expected=False, passing=False, flaky=False, extra_tests=['failures/expected/wontfix.html'], extra_expectations='Bug(x) failures/expected/wontfix.html [ WontFix ]\n') 196 196 self.assertTrue(expected_results['tests']['failures']['expected']['wontfix.html']['wontfix']) -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r129148 r129184 77 77 TIMEOUT_EXPECTATION = 'timeout' 78 78 79 MISSING_BUG_WARNING = 'Test lacks BUG modifier.' 80 79 81 def __init__(self, port, full_test_list, allow_rebaseline_modifier): 80 82 self._port = port … … 155 157 156 158 if not expectation_line.parsed_bug_modifiers and not has_wontfix and not has_bugid: 157 expectation_line.warnings.append( 'Test lacks BUG modifier.')159 expectation_line.warnings.append(self.MISSING_BUG_WARNING) 158 160 159 161 if self._allow_rebaseline_modifier and self.REBASELINE_MODIFIER in modifiers: … … 393 395 warnings.append('Missing a "]"') 394 396 395 if not expectations: 397 if 'WONTFIX' in modifiers and 'SKIP' not in modifiers: 398 modifiers.append('SKIP') 399 400 if 'SKIP' in modifiers and expectations: 401 # FIXME: This is really a semantic warning and shouldn't be here. Remove when we drop the old syntax. 402 warnings.append('A test marked Skip or WontFix must not have other expectations.') 403 elif not expectations: 396 404 if 'SKIP' not in modifiers and 'REBASELINE' not in modifiers and 'SLOW' not in modifiers: 397 405 modifiers.append('SKIP') … … 432 440 433 441 def is_invalid(self): 434 return len(self.warnings) > 0442 return self.warnings and self.warnings != [TestExpectationParser.MISSING_BUG_WARNING] 435 443 436 444 def is_flaky(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r129052 r129184 69 69 return """ 70 70 BUG_TEST : failures/expected/text.html = FAIL 71 BUG_TEST WONTFIX SKIP : failures/expected/crash.html = CRASH71 BUG_TEST WONTFIX : failures/expected/crash.html = PASS 72 72 BUG_TEST REBASELINE : failures/expected/missing_image.html = MISSING 73 BUG_TEST WONTFIX : failures/expected/image_checksum.html = IMAGE74 BUG_TEST WONTFIX MAC : failures/expected/image.html = IMAGE73 BUG_TEST WONTFIX : failures/expected/image_checksum.html = PASS 74 BUG_TEST WONTFIX MAC : failures/expected/image.html = PASS 75 75 """ 76 76 … … 95 95 self.parse_exp(self.get_basic_expectations()) 96 96 self.assert_exp('failures/expected/text.html', FAIL) 97 self.assert_exp('failures/expected/image_checksum.html', IMAGE)97 self.assert_exp('failures/expected/image_checksum.html', PASS) 98 98 self.assert_exp('passes/text.html', PASS) 99 99 self.assert_exp('failures/expected/image.html', PASS) … … 138 138 # present in the expectations. 139 139 exp_str = """ 140 BUGX WONTFIX : failures/expected = IMAGE140 BUGX WONTFIX : failures/expected = PASS 141 141 """ 142 142 self.parse_exp(exp_str) … … 145 145 self.assertRaises(KeyError, self._exp.get_expectations, 146 146 unknown_test) 147 self.assert_exp('failures/expected/crash.html', IMAGE)147 self.assert_exp('failures/expected/crash.html', PASS) 148 148 149 149 def test_get_modifiers(self): … … 171 171 set([self.get_test('failures/expected/crash.html'), 172 172 self.get_test('failures/expected/image_checksum.html')])) 173 s = self._exp.get_test_set(WONTFIX, CRASH)174 self.assertEqual(s,175 set([self.get_test('failures/expected/crash.html')]))176 s = self._exp.get_test_set(WONTFIX, CRASH, include_skips=False)177 self.assertEqual(s, set([]))178 173 179 174 def test_parse_warning(self): … … 192 187 self.assertEqual(str(e), warnings) 193 188 194 try:195 self.parse_exp('SKIP : failures/expected/text.html = FAIL', is_lint_mode=True)196 self.assertFalse(True, "ParseError wasn't raised")197 except ParseError, e:198 warnings = u'expectations:1 Test lacks BUG modifier. failures/expected/text.html'199 self.assertEqual(str(e), warnings)200 201 189 def test_error_on_different_platform(self): 202 190 # parse_exp uses a Windows port. Assert errors on Mac show up in lint mode. … … 237 225 self.assertFalse(match('failures/expected/text.html', CRASH, True)) 238 226 self.assertFalse(match('failures/expected/text.html', CRASH, False)) 239 self.assertTrue(match('failures/expected/image_checksum.html', IMAGE,227 self.assertTrue(match('failures/expected/image_checksum.html', PASS, 240 228 True)) 241 229 self.assertTrue(match('failures/expected/image_checksum.html', PASS, 242 230 False)) 243 self.assertTrue(match('failures/expected/crash.html', SKIP, False))231 self.assertTrue(match('failures/expected/crash.html', PASS, False)) 244 232 self.assertTrue(match('passes/text.html', PASS, False)) 245 233 … … 471 459 self.assertTrue(self._exp.has_warnings()) 472 460 461 self.parse_exp('failures/expected/text.html [ Failure ]') 462 line = self._exp._model.get_expectation_line('failures/expected/text.html') 463 self.assertFalse(line.is_invalid()) 464 self.assertEquals(line.warnings, ['Test lacks BUG modifier.']) 465 466 def test_skip_and_wontfix(self): 467 # Skip and WontFix are not allowed to have other expectations as well, because those 468 # expectations won't be exercised and may become stale . 469 self.parse_exp('failures/expected/text.html [ Failure Skip ]') 470 self.assertTrue(self._exp.has_warnings()) 471 472 self.parse_exp('failures/expected/text.html [ Crash WontFix ]') 473 self.assertTrue(self._exp.has_warnings()) 474 475 # We can't warn against [ Pass WontFix ] until we get rid of the old syntax. 476 self.parse_exp('failures/expected/text.html [ Pass WontFix ]') 477 self.assertFalse(self._exp.has_warnings()) 478 473 479 def test_slow_and_timeout(self): 474 480 # A test cannot be SLOW and expected to TIMEOUT. … … 504 510 exp_str = """ 505 511 BUGX : failures/expected/text.html = FAIL 506 BUGX WONTFIX : failures/expected = IMAGE512 BUGX WONTFIX : failures/expected = PASS 507 513 """ 508 514 self.parse_exp(exp_str) 509 515 self.assert_exp('failures/expected/text.html', FAIL) 510 self.assert_exp('failures/expected/crash.html', IMAGE)516 self.assert_exp('failures/expected/crash.html', PASS) 511 517 512 518 exp_str = """ 513 BUGX WONTFIX : failures/expected = IMAGE519 BUGX WONTFIX : failures/expected = PASS 514 520 BUGX : failures/expected/text.html = FAIL 515 521 """ 516 522 self.parse_exp(exp_str) 517 523 self.assert_exp('failures/expected/text.html', FAIL) 518 self.assert_exp('failures/expected/crash.html', IMAGE)524 self.assert_exp('failures/expected/crash.html', PASS) 519 525 520 526 def test_ambiguous(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py
r129047 r129184 259 259 if not filesystem.exists(LAYOUT_TEST_DIR + '/platform/test/TestExpectations'): 260 260 filesystem.write_text_file(LAYOUT_TEST_DIR + '/platform/test/TestExpectations', """ 261 WONTFIX : failures/expected/crash.html = CRASH 262 WONTFIX : failures/expected/image.html = IMAGE 263 WONTFIX : failures/expected/audio.html = FAIL 264 WONTFIX : failures/expected/image_checksum.html = IMAGE 265 WONTFIX : failures/expected/mismatch.html = IMAGE 266 WONTFIX : failures/expected/missing_check.html = MISSING PASS 267 WONTFIX : failures/expected/missing_image.html = MISSING PASS 268 WONTFIX : failures/expected/missing_audio.html = MISSING PASS 269 WONTFIX : failures/expected/missing_text.html = MISSING PASS 270 WONTFIX : failures/expected/newlines_leading.html = FAIL 271 WONTFIX : failures/expected/newlines_trailing.html = FAIL 272 WONTFIX : failures/expected/newlines_with_excess_CR.html = FAIL 273 WONTFIX : failures/expected/reftest.html = IMAGE 274 WONTFIX : failures/expected/text.html = FAIL 275 WONTFIX : failures/expected/timeout.html = TIMEOUT 276 WONTFIX SKIP : failures/expected/hang.html = TIMEOUT 277 WONTFIX SKIP : failures/expected/keyboard.html = CRASH 278 WONTFIX SKIP : failures/expected/exception.html = CRASH 279 WONTFIX SKIP : passes/skipped/skip.html = PASS 261 Bug(test) failures/expected/crash.html [ Crash ] 262 Bug(test) failures/expected/image.html [ ImageOnlyFailure ] 263 Bug(test) failures/expected/audio.html [ Failure ] 264 Bug(test) failures/expected/image_checksum.html [ ImageOnlyFailure ] 265 Bug(test) failures/expected/mismatch.html [ ImageOnlyFailure ] 266 Bug(test) failures/expected/missing_check.html [ Missing Pass ] 267 Bug(test) failures/expected/missing_image.html [ Missing Pass ] 268 Bug(test) failures/expected/missing_audio.html [ Missing Pass ] 269 Bug(test) failures/expected/missing_text.html [ Missing Pass ] 270 Bug(test) failures/expected/newlines_leading.html [ Failure ] 271 Bug(test) failures/expected/newlines_trailing.html [ Failure ] 272 Bug(test) failures/expected/newlines_with_excess_CR.html [ Failure ] 273 Bug(test) failures/expected/reftest.html [ ImageOnlyFailure ] 274 Bug(test) failures/expected/text.html [ Failure ] 275 Bug(test) failures/expected/timeout.html [ Timeout ] 276 Bug(test) failures/expected/hang.html [ WontFix ] 277 Bug(test) failures/expected/keyboard.html [ WontFix ] 278 Bug(test) failures/expected/exception.html [ WontFix ] 279 Bug(test) passes/skipped/skip.html [ Skip ] 280 280 """) 281 281 … … 538 538 raise ValueError('exception from ' + test_name) 539 539 if test.hang: 540 time.sleep((float(test_input.timeout) * 4) / 1000.0 )540 time.sleep((float(test_input.timeout) * 4) / 1000.0 + 1.0) # The 1.0 comes from thread_padding_sec in layout_test_runnery. 541 541 542 542 audio = None -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r129148 r129184 348 348 'failures/expected/hang.html'], 349 349 tests_included=True) 350 self.assertEqual(res, 0) 350 # Note that hang.html is marked as WontFix and all WontFix tests are 351 # expected to Pass, so that actually running them generates an "unexpected" error. 352 self.assertEqual(res, 1) 351 353 self.assertNotEmpty(out) 352 354 self.assertNotEmpty(err) -
trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
r129052 r129184 179 179 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 180 180 ('// For test-win-xp\n' 181 'failures/expected/image.html [ ImageOnlyFailure WontFix]\n'182 'failures/expected/text.html [ Failure WontFix]\n'))181 'failures/expected/image.html [ ImageOnlyFailure ]\n' 182 'failures/expected/text.html [ Failure ]\n')) 183 183 184 184 def test_multiple(self): 185 185 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 186 186 ('// For test-win-vista\n' 187 'failures/expected/image.html [ ImageOnlyFailure WontFix]\n'188 'failures/expected/text.html [ Failure WontFix]\n'187 'failures/expected/image.html [ ImageOnlyFailure ]\n' 188 'failures/expected/text.html [ Failure ]\n' 189 189 '\n' 190 190 '// For test-win-win7\n' 191 'failures/expected/image.html [ ImageOnlyFailure WontFix]\n'192 'failures/expected/text.html [ Failure WontFix]\n'191 'failures/expected/image.html [ ImageOnlyFailure ]\n' 192 'failures/expected/text.html [ Failure ]\n' 193 193 '\n' 194 194 '// For test-win-xp\n' 195 'failures/expected/image.html [ ImageOnlyFailure WontFix]\n'196 'failures/expected/text.html [ Failure WontFix]\n'),195 'failures/expected/image.html [ ImageOnlyFailure ]\n' 196 'failures/expected/text.html [ Failure ]\n'), 197 197 platform='test-win-*') 198 198 … … 200 200 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 201 201 ('// For test-win-xp\n' 202 ' failures/expected/image.html [ ImageOnlyFailure WontFix]\n'203 ' failures/expected/text.html [ Failure WontFix]\n'),202 'Bug(test) failures/expected/image.html [ ImageOnlyFailure ]\n' 203 'Bug(test) failures/expected/text.html [ Failure ]\n'), 204 204 full=True) 205 205 … … 207 207 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 208 208 ('// For test-win-xp\n' 209 'failures/expected/text.html [ Failure WontFix]\n'),209 'failures/expected/text.html [ Failure ]\n'), 210 210 exclude_keyword=['image']) 211 211 … … 218 218 def test_csv(self): 219 219 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 220 ('test-win-xp,failures/expected/image.html, WONTFIX,IMAGE\n'221 'test-win-xp,failures/expected/text.html, WONTFIX,FAIL\n'),220 ('test-win-xp,failures/expected/image.html,BUGTEST,IMAGE\n' 221 'test-win-xp,failures/expected/text.html,BUGTEST,FAIL\n'), 222 222 csv=True) 223 223
Note: See TracChangeset
for help on using the changeset viewer.