Changeset 244789 in webkit
- Timestamp:
- Apr 30, 2019 11:33:30 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/ews-build/steps.py
r244769 r244789 468 468 command = ['Tools/Scripts/run-bindings-tests', '--json-output={0}'.format(jsonFileName)] 469 469 470 def __init__(self, **kwargs): 471 super(RunBindingsTests, self).__init__(timeout=5 * 60, **kwargs) 472 473 def start(self): 474 self.log_observer = logobserver.BufferLogObserver() 475 self.addLogObserver('json', self.log_observer) 476 return shell.ShellCommand.start(self) 477 478 def getResultSummary(self): 479 if self.results == SUCCESS: 480 message = 'Passed bindings tests' 481 self.build.buildFinished([message], SUCCESS) 482 return {u'step': unicode(message)} 483 484 logLines = self.log_observer.getStdout() 485 json_text = ''.join([line for line in logLines.splitlines()]) 486 try: 487 webkitpy_results = json.loads(json_text) 488 except Exception as ex: 489 self._addToLog('stderr', 'ERROR: unable to parse data, exception: {}'.format(ex)) 490 return super(RunBindingsTests, self).getResultSummary() 491 492 failures = webkitpy_results.get('failures') 493 if not failures: 494 return super(RunBindingsTests, self).getResultSummary() 495 pluralSuffix = 's' if len(failures) > 1 else '' 496 failures_string = ', '.join([failure.replace('(JS) ', '') for failure in failures]) 497 message = 'Found {} Binding test failure{}: {}'.format(len(failures), pluralSuffix, failures_string) 498 self.build.buildFinished([message], FAILURE) 499 return {u'step': unicode(message)} 500 501 @defer.inlineCallbacks 502 def _addToLog(self, logName, message): 503 try: 504 log = self.getLog(logName) 505 except KeyError: 506 log = yield self.addLog(logName) 507 log.addStdout(message) 508 470 509 471 510 class RunWebKitPerlTests(shell.ShellCommand): -
trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py
r244769 r244789 295 295 self.expectRemoteCommands( 296 296 ExpectShell(workdir='wkdir', 297 timeout=300, 297 298 command=['Tools/Scripts/run-bindings-tests', '--json-output={0}'.format(self.jsonFileName)], 298 299 logfiles={'json': self.jsonFileName}, … … 300 301 + 0, 301 302 ) 302 self.expectOutcome(result=SUCCESS, state_string=' bindings-tests')303 self.expectOutcome(result=SUCCESS, state_string='Passed bindings tests') 303 304 return self.runStep() 304 305 … … 307 308 self.expectRemoteCommands( 308 309 ExpectShell(workdir='wkdir', 310 timeout=300, 309 311 command=['Tools/Scripts/run-bindings-tests', '--json-output={0}'.format(self.jsonFileName)], 310 312 logfiles={'json': self.jsonFileName}, -
trunk/Tools/ChangeLog
r244778 r244789 1 2019-04-30 Aakash Jain <aakash_jain@apple.com> 2 3 [ews-build] Parse and display bindings test failures 4 https://bugs.webkit.org/show_bug.cgi?id=197423 5 6 Reviewed by Lucas Forschler. 7 8 * BuildSlaveSupport/ews-build/steps.py: 9 (RunBindingsTests.__init__): Set timeout of 5 minutes. 10 (RunBindingsTests.start): Initialize log_observer for json output. 11 (RunBindingsTests.getResultSummary): Update step and build summary based on bindings test results. 12 (RunBindingsTests._addToLog): Method to add message to log. 13 * BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-test accordingly. 14 1 15 2019-04-30 Pablo Saavedra <psaavedra@igalia.com> 2 16
Note: See TracChangeset
for help on using the changeset viewer.