Title: [255684] trunk/Tools
Revision
255684
Author
aakash_j...@apple.com
Date
2020-02-04 10:21:34 -0800 (Tue, 04 Feb 2020)

Log Message

[EWS] Do not remove webkitpy prefix from test failures
https://bugs.webkit.org/show_bug.cgi?id=207206

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(WebKitPyTest.getResultSummary): Do not remove 'webkitpy' from test name. Also handled the
case when json output doesn't have failures/errors key.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

Modified Paths

Diff

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


--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2020-02-04 17:47:26 UTC (rev 255683)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2020-02-04 18:21:34 UTC (rev 255684)
@@ -753,11 +753,11 @@
             self._addToLog('stderr', 'ERROR: unable to parse data, exception: {}'.format(ex))
             return super(WebKitPyTest, self).getResultSummary()
 
-        failures = webkitpy_results.get('failures') + webkitpy_results.get('errors')
+        failures = webkitpy_results.get('failures', []) + webkitpy_results.get('errors', [])
         if not failures:
             return super(WebKitPyTest, self).getResultSummary()
         pluralSuffix = 's' if len(failures) > 1 else ''
-        failures_string = ', '.join([failure.get('name').replace('webkitpy.', '') for failure in failures])
+        failures_string = ', '.join([failure.get('name') for failure in failures])
         message = 'Found {} webkitpy {} test failure{}: {}'.format(len(failures), self.language, pluralSuffix, failures_string)
         self.setBuildSummary(message)
         return {u'step': unicode(message)}

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


--- trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py	2020-02-04 17:47:26 UTC (rev 255683)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py	2020-02-04 18:21:34 UTC (rev 255684)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+# Copyright (C) 2018-2020 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -423,6 +423,9 @@
     def setUp(self):
         self.longMessage = True
         self.jsonFileName = 'webkitpy_test_python2_results.json'
+        self.json_with_failure = '''{"failures": [{"name": "webkitpy.port.wpe_unittest.WPEPortTest.test_diff_image"}]}\n'''
+        self.json_with_errros = '''{"failures": [],
+"errors": [{"name": "webkitpy.style.checkers.cpp_unittest.WebKitStyleTest.test_os_version_checks"}, {"name": "webkitpy.port.win_unittest.WinPortTest.test_diff_image__missing_actual"}]}\n'''
         return self.setUpBuildStep()
 
     def tearDown(self):
@@ -442,7 +445,7 @@
         self.expectOutcome(result=SUCCESS, state_string='Passed webkitpy python2 tests')
         return self.runStep()
 
-    def test_failure(self):
+    def test_unexpected_failure(self):
         self.setupStep(RunWebKitPyPython2Tests())
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
@@ -458,11 +461,44 @@
         self.expectOutcome(result=FAILURE, state_string='webkitpy-tests (failure)')
         return self.runStep()
 
+    def test_failure(self):
+        self.setupStep(RunWebKitPyPython2Tests())
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['python', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
+                        timeout=120,
+                        ) +
+            ExpectShell.log('json', stdout=self.json_with_failure) +
+            2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Found 1 webkitpy python2 test failure: webkitpy.port.wpe_unittest.WPEPortTest.test_diff_image')
+        return self.runStep()
 
+    def test_errors(self):
+        self.setupStep(RunWebKitPyPython2Tests())
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['python', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
+                        timeout=120,
+                        ) +
+            ExpectShell.log('json', stdout=self.json_with_errros) +
+            2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Found 2 webkitpy python2 test failures: webkitpy.style.checkers.cpp_unittest.WebKitStyleTest.test_os_version_checks, webkitpy.port.win_unittest.WinPortTest.test_diff_image__missing_actual')
+        return self.runStep()
+
+
 class TestWebKitPyPython3Tests(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True
         self.jsonFileName = 'webkitpy_test_python3_results.json'
+        self.json_with_failure = '''{"failures": [{"name": "webkitpy.port.wpe_unittest.WPEPortTest.test_diff_image"}]}\n'''
+        self.json_with_errros = '''{"failures": [],
+"errors": [{"name": "webkitpy.style.checkers.cpp_unittest.WebKitStyleTest.test_os_version_checks"}, {"name": "webkitpy.port.win_unittest.WinPortTest.test_diff_image__missing_actual"}]}\n'''
         return self.setUpBuildStep()
 
     def tearDown(self):
@@ -482,7 +518,7 @@
         self.expectOutcome(result=SUCCESS, state_string='Passed webkitpy python3 tests')
         return self.runStep()
 
-    def test_failure(self):
+    def test_unexpected_failure(self):
         self.setupStep(RunWebKitPyPython3Tests())
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
@@ -498,7 +534,37 @@
         self.expectOutcome(result=FAILURE, state_string='webkitpy-tests (failure)')
         return self.runStep()
 
+    def test_failure(self):
+        self.setupStep(RunWebKitPyPython3Tests())
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['python3', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
+                        timeout=120,
+                        ) +
+            ExpectShell.log('json', stdout=self.json_with_failure) +
+            2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Found 1 webkitpy python3 test failure: webkitpy.port.wpe_unittest.WPEPortTest.test_diff_image')
+        return self.runStep()
 
+    def test_errors(self):
+        self.setupStep(RunWebKitPyPython3Tests())
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['python3', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
+                        timeout=120,
+                        ) +
+            ExpectShell.log('json', stdout=self.json_with_errros) +
+            2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Found 2 webkitpy python3 test failures: webkitpy.style.checkers.cpp_unittest.WebKitStyleTest.test_os_version_checks, webkitpy.port.win_unittest.WinPortTest.test_diff_image__missing_actual')
+        return self.runStep()
+
+
 class TestRunEWSBuildbotCheckConfig(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True

Modified: trunk/Tools/ChangeLog (255683 => 255684)


--- trunk/Tools/ChangeLog	2020-02-04 17:47:26 UTC (rev 255683)
+++ trunk/Tools/ChangeLog	2020-02-04 18:21:34 UTC (rev 255684)
@@ -1,3 +1,15 @@
+2020-02-04  Aakash Jain  <aakash_j...@apple.com>
+
+        [EWS] Do not remove webkitpy prefix from test failures
+        https://bugs.webkit.org/show_bug.cgi?id=207206
+
+        Reviewed by Jonathan Bedard.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (WebKitPyTest.getResultSummary): Do not remove 'webkitpy' from test name. Also handled the
+        case when json output doesn't have failures/errors key.
+        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
+
 2020-02-04  Ross Kirsling  <ross.kirsl...@sony.com>
 
         [CMake] Add Cairo::Cairo target
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to