Changeset 90650 in webkit
- Timestamp:
- Jul 8, 2011 12:05:17 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
r90310 r90650 332 332 return shell.Test.start(self) 333 333 334 class RunPythonTests(shell.Test): 334 335 class TestWithFailureCount(shell.Test): 336 failedTestsFormatString = "%d tests failed" 337 338 def countFailures(self, cmd): 339 return 0 340 341 def commandComplete(self, cmd): 342 shell.Test.commandComplete(self, cmd) 343 self.failedTestCount = self.countFailures(cmd) 344 345 def evaluateCommand(self, cmd): 346 if self.failedTestCount: 347 return FAILURE 348 349 if cmd.rc != 0: 350 return FAILURE 351 352 return SUCCESS 353 354 def getText(self, cmd, results): 355 return self.getText2(cmd, results) 356 357 def getText2(self, cmd, results): 358 if results != SUCCESS and self.failedTestCount: 359 return [self.failedTestsFormatString % self.failedTestCount] 360 361 return [self.name] 362 363 364 class RunPythonTests(TestWithFailureCount): 335 365 name = "webkitpy-test" 336 366 description = ["python-tests running"] 337 367 descriptionDone = ["python-tests"] 338 368 command = ["python", "./Tools/Scripts/test-webkitpy"] 339 340 341 class RunPerlTests(shell.Test): 369 failedTestsFormatString = "%d python tests failed" 370 371 def countFailures(self, cmd): 372 logText = cmd.logs['stdio'].getText() 373 # We're looking for the line that looks like this: FAILED (failures=2, errors=1) 374 regex = re.compile(r'^FAILED \((?P<counts>[^)]+)\)') 375 for line in logText.splitlines(): 376 match = regex.match(line) 377 if not match: 378 continue 379 return sum(int(component.split('=')[1]) for component in match.group('counts').split(', ')) 380 return 0 381 382 383 class RunPerlTests(TestWithFailureCount): 342 384 name = "webkitperl-test" 343 385 description = ["perl-tests running"] 344 386 descriptionDone = ["perl-tests"] 345 387 command = ["perl", "./Tools/Scripts/test-webkitperl"] 388 failedTestsFormatString = "%d perl tests failed" 389 390 def countFailures(self, cmd): 391 logText = cmd.logs['stdio'].getText() 392 # We're looking for the line that looks like this: Failed 2/19 test programs. 5/363 subtests failed. 393 regex = re.compile(r'^Failed \d+/\d+ test programs\. (?P<count>\d+)/\d+ subtests failed\.') 394 for line in logText.splitlines(): 395 match = regex.match(line) 396 if not match: 397 continue 398 return int(match.group('count')) 399 return 0 346 400 347 401 -
trunk/Tools/ChangeLog
r90648 r90650 1 2011-07-08 Adam Roben <aroben@apple.com> 2 3 Teach buildbot to figure out how many webkitpy/webkitperl tests failed 4 5 Fixes <http://webkit.org/b/64192> It's hard to tell how many test-webkitpy/test-webkitperl 6 tests failed when looking at build.webkit.org 7 8 Reviewed by Eric Seidel. 9 10 * BuildSlaveSupport/build.webkit.org-config/master.cfg: 11 (TestWithFailureCount): New class that represents a test build step which has an associated 12 failure count. Eventually we should move more of our test classes to deriving from this. 13 (TestWithFailureCount.countFailures): Method for subclasses to override to say how many 14 failures occurred. 15 16 (TestWithFailureCount.commandComplete): 17 (TestWithFailureCount.evaluateCommand): 18 (TestWithFailureCount.getText): 19 (TestWithFailureCount.getText2): 20 These were all based on RunGtkAPITests. 21 22 (RunPythonTests): Changed to inherit from TestWithFailureCount. 23 (RunPythonTests.countFailures): Parses the test-webkitpy output looking for the count of 24 failures. 25 (RunPerlTests): Changed to inherit from TestWithFailureCount. 26 (RunPerlTests.countFailures): Parses the test-webkitperl output looking for the count of 27 failures. 28 1 29 2011-07-08 Adam Roben <aroben@apple.com> 2 30
Note: See TracChangeset
for help on using the changeset viewer.