Title: [244789] trunk/Tools
Revision
244789
Author
[email protected]
Date
2019-04-30 11:33:30 -0700 (Tue, 30 Apr 2019)

Log Message

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

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(RunBindingsTests.__init__): Set timeout of 5 minutes.
(RunBindingsTests.start): Initialize log_observer for json output.
(RunBindingsTests.getResultSummary): Update step and build summary based on bindings test results.
(RunBindingsTests._addToLog): Method to add message to log.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-test accordingly.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps.py (244788 => 244789)


--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2019-04-30 18:29:13 UTC (rev 244788)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2019-04-30 18:33:30 UTC (rev 244789)
@@ -467,7 +467,46 @@
     logfiles = {'json': jsonFileName}
     command = ['Tools/Scripts/run-bindings-tests', '--json-output={0}'.format(jsonFileName)]
 
+    def __init__(self, **kwargs):
+        super(RunBindingsTests, self).__init__(timeout=5 * 60, **kwargs)
 
+    def start(self):
+        self.log_observer = logobserver.BufferLogObserver()
+        self.addLogObserver('json', self.log_observer)
+        return shell.ShellCommand.start(self)
+
+    def getResultSummary(self):
+        if self.results == SUCCESS:
+            message = 'Passed bindings tests'
+            self.build.buildFinished([message], SUCCESS)
+            return {u'step': unicode(message)}
+
+        logLines = self.log_observer.getStdout()
+        json_text = ''.join([line for line in logLines.splitlines()])
+        try:
+            webkitpy_results = json.loads(json_text)
+        except Exception as ex:
+            self._addToLog('stderr', 'ERROR: unable to parse data, exception: {}'.format(ex))
+            return super(RunBindingsTests, self).getResultSummary()
+
+        failures = webkitpy_results.get('failures')
+        if not failures:
+            return super(RunBindingsTests, self).getResultSummary()
+        pluralSuffix = 's' if len(failures) > 1 else ''
+        failures_string = ', '.join([failure.replace('(JS) ', '') for failure in failures])
+        message = 'Found {} Binding test failure{}: {}'.format(len(failures), pluralSuffix, failures_string)
+        self.build.buildFinished([message], FAILURE)
+        return {u'step': unicode(message)}
+
+    @defer.inlineCallbacks
+    def _addToLog(self, logName, message):
+        try:
+            log = self.getLog(logName)
+        except KeyError:
+            log = yield self.addLog(logName)
+        log.addStdout(message)
+
+
 class RunWebKitPerlTests(shell.ShellCommand):
     name = 'webkitperl-tests'
     description = ['webkitperl-tests running']

Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py (244788 => 244789)


--- trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py	2019-04-30 18:29:13 UTC (rev 244788)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py	2019-04-30 18:33:30 UTC (rev 244789)
@@ -294,12 +294,13 @@
         self.setupStep(RunBindingsTests())
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
+                        timeout=300,
                         command=['Tools/Scripts/run-bindings-tests', '--json-output={0}'.format(self.jsonFileName)],
                         logfiles={'json': self.jsonFileName},
                         )
             + 0,
         )
-        self.expectOutcome(result=SUCCESS, state_string='bindings-tests')
+        self.expectOutcome(result=SUCCESS, state_string='Passed bindings tests')
         return self.runStep()
 
     def test_failure(self):
@@ -306,6 +307,7 @@
         self.setupStep(RunBindingsTests())
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
+                        timeout=300,
                         command=['Tools/Scripts/run-bindings-tests', '--json-output={0}'.format(self.jsonFileName)],
                         logfiles={'json': self.jsonFileName},
                         )

Modified: trunk/Tools/ChangeLog (244788 => 244789)


--- trunk/Tools/ChangeLog	2019-04-30 18:29:13 UTC (rev 244788)
+++ trunk/Tools/ChangeLog	2019-04-30 18:33:30 UTC (rev 244789)
@@ -1,3 +1,17 @@
+2019-04-30  Aakash Jain  <[email protected]>
+
+        [ews-build] Parse and display bindings test failures
+        https://bugs.webkit.org/show_bug.cgi?id=197423
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (RunBindingsTests.__init__): Set timeout of 5 minutes.
+        (RunBindingsTests.start): Initialize log_observer for json output.
+        (RunBindingsTests.getResultSummary): Update step and build summary based on bindings test results.
+        (RunBindingsTests._addToLog): Method to add message to log.
+        * BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-test accordingly.
+
 2019-04-30  Pablo Saavedra  <[email protected]>
 
         Unreviewed. Add myself as a committer.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to