⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244769 in webkit


Ignore:
Timestamp:
Apr 30, 2019, 7:51:13 AM (7 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Parse and display webkitpy failures
https://bugs.webkit.org/show_bug.cgi?id=197395

Reviewed by Lucas Forschler.

  • BuildSlaveSupport/ews-build/steps.py:

(RunWebKitPyTests.start): Initialize log_observer for json output.
(RunWebKitPyTests.getResultSummary): Update step and build summary based on webkitpy results.
(RunWebKitPyTests._addToLog): Method to add message to log.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-test accordingly.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-build/steps.py

    r244533 r244769  
    492492        super(RunWebKitPyTests, self).__init__(timeout=2 * 60, **kwargs)
    493493
     494    def start(self):
     495        self.log_observer = logobserver.BufferLogObserver()
     496        self.addLogObserver('json', self.log_observer)
     497        return shell.ShellCommand.start(self)
     498
     499    def getResultSummary(self):
     500        if self.results == SUCCESS:
     501            message = 'Passed webkitpy tests'
     502            self.build.buildFinished([message], SUCCESS)
     503            return {u'step': unicode(message)}
     504
     505        logLines = self.log_observer.getStdout()
     506        json_text = ''.join([line for line in logLines.splitlines()])
     507        try:
     508            webkitpy_results = json.loads(json_text)
     509        except Exception as ex:
     510            self._addToLog('stderr', 'ERROR: unable to parse data, exception: {}'.format(ex))
     511            return super(RunWebKitPyTests, self).getResultSummary()
     512
     513        failures = webkitpy_results.get('failures') + webkitpy_results.get('errors')
     514        if not failures:
     515            return super(RunWebKitPyTests, self).getResultSummary()
     516        pluralSuffix = 's' if len(failures) > 1 else ''
     517        failures_string = ', '.join([failure.get('name').replace('webkitpy.', '') for failure in failures])
     518        message = 'Found {} WebKitPy test failure{}: {}'.format(len(failures), pluralSuffix, failures_string)
     519        self.build.buildFinished([message], FAILURE)
     520        return {u'step': unicode(message)}
     521
     522    @defer.inlineCallbacks
     523    def _addToLog(self, logName, message):
     524        try:
     525            log = self.getLog(logName)
     526        except KeyError:
     527            log = yield self.addLog(logName)
     528        log.addStdout(message)
     529
    494530
    495531def appendCustomBuildFlags(step, platform, fullPlatform):
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r244551 r244769  
    373373            + 0,
    374374        )
    375         self.expectOutcome(result=SUCCESS, state_string='webkitpy-tests')
     375        self.expectOutcome(result=SUCCESS, state_string='Passed webkitpy tests')
    376376        return self.runStep()
    377377
  • trunk/Tools/ChangeLog

    r244756 r244769  
     12019-04-30  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Parse and display webkitpy failures
     4        https://bugs.webkit.org/show_bug.cgi?id=197395
     5
     6        Reviewed by Lucas Forschler.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (RunWebKitPyTests.start): Initialize log_observer for json output.
     10        (RunWebKitPyTests.getResultSummary): Update step and build summary based on webkitpy results.
     11        (RunWebKitPyTests._addToLog): Method to add message to log.
     12        * BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-test accordingly.
     13
    1142019-04-29  Alex Christensen  <achristensen@webkit.org>
    215
Note: See TracChangeset for help on using the changeset viewer.