Title: [274209] trunk/Tools
Revision
274209
Author
[email protected]
Date
2021-03-10 04:52:34 -0800 (Wed, 10 Mar 2021)

Log Message

[build.webkit.org] Update RunJavaScriptCoreTests step for new buildbot
https://bugs.webkit.org/show_bug.cgi?id=223011

Reviewed by Dewei Zhu.

* CISupport/build-webkit-org/steps.py:
(RunJavaScriptCoreTests.start): Used logobserver.
(RunJavaScriptCoreTests.countFailures):
* CISupport/build-webkit-org/steps_unittest.py:
(TestRunJavaScriptCoreTests.test_success): Added unit-test.
(TestRunJavaScriptCoreTests.test_failure): Ditto.

Modified Paths

Diff

Modified: trunk/Tools/CISupport/build-webkit-org/steps.py (274208 => 274209)


--- trunk/Tools/CISupport/build-webkit-org/steps.py	2021-03-10 11:56:00 UTC (rev 274208)
+++ trunk/Tools/CISupport/build-webkit-org/steps.py	2021-03-10 12:52:34 UTC (rev 274209)
@@ -432,6 +432,10 @@
 
     def start(self):
         self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.log_observer = logobserver.BufferLogObserver()
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
+
         platform = self.getProperty('platform')
         architecture = self.getProperty("architecture")
         # Currently run-_javascript_core-test doesn't support run _javascript_ core test binaries list below remotely
@@ -449,7 +453,7 @@
         return shell.Test.start(self)
 
     def countFailures(self, cmd):
-        logText = cmd.logs['stdio'].getText()
+        logText = self.log_observer.getStdout()
         count = 0
 
         match = re.search(r'^Results for JSC stress tests:\r?\n\s+(\d+) failure', logText, re.MULTILINE)

Modified: trunk/Tools/CISupport/build-webkit-org/steps_unittest.py (274208 => 274209)


--- trunk/Tools/CISupport/build-webkit-org/steps_unittest.py	2021-03-10 11:56:00 UTC (rev 274208)
+++ trunk/Tools/CISupport/build-webkit-org/steps_unittest.py	2021-03-10 12:52:34 UTC (rev 274209)
@@ -909,3 +909,56 @@
         )
         self.expectOutcome(result=EXCEPTION, state_string='layout-tests (exception)')
         return self.runStep()
+
+
+class TestRunJavaScriptCoreTests(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        os.environ['RESULTS_SERVER_API_KEY'] = 'test-api-key'
+        self.jsonFileName = 'jsc_results.json'
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        del os.environ['RESULTS_SERVER_API_KEY']
+        return self.tearDownBuildStep()
+
+    def configureStep(self, platform=None, fullPlatform=None, configuration=None):
+        self.setupStep(RunJavaScriptCoreTests())
+        if platform:
+            self.setProperty('platform', platform)
+        if fullPlatform:
+            self.setProperty('fullPlatform', fullPlatform)
+        if configuration:
+            self.setProperty('configuration', configuration)
+        self.setProperty('buildername', 'JSC-Tests')
+        self.setProperty('buildnumber', '101')
+        self.setProperty('workername', 'bot100')
+
+    def test_success(self):
+        self.configureStep(platform='mac', fullPlatform='mac-highsierra', configuration='release')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['perl', './Tools/Scripts/run-_javascript_core-tests', '--no-build', '--no-fail-fast', '--json-output={0}'.format(self.jsonFileName), '--release', '--builder-name', 'JSC-Tests', '--build-number', '101', '--buildbot-worker', 'bot100', '--buildbot-master', CURRENT_HOSTNAME, '--report', 'https://results.webkit.org'],
+                        logfiles={'json': self.jsonFileName},
+                        env={'RESULTS_SERVER_API_KEY': 'test-api-key'}
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='jscore-test')
+        return self.runStep()
+
+    def test_failure(self):
+        self.configureStep(platform='mac', fullPlatform='mac-highsierra', configuration='debug')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['perl', './Tools/Scripts/run-_javascript_core-tests', '--no-build', '--no-fail-fast', '--json-output={0}'.format(self.jsonFileName), '--debug', '--builder-name', 'JSC-Tests', '--build-number', '101', '--buildbot-worker', 'bot100', '--buildbot-master', CURRENT_HOSTNAME, '--report', 'https://results.webkit.org'],
+                        logfiles={'json': self.jsonFileName},
+                        env={'RESULTS_SERVER_API_KEY': 'test-api-key'}
+                        )
+            + ExpectShell.log('stdio', stdout='Results for JSC stress tests:\n 9 failures found.')
+            + 2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='9 JSC tests failed')
+        return self.runStep()

Modified: trunk/Tools/ChangeLog (274208 => 274209)


--- trunk/Tools/ChangeLog	2021-03-10 11:56:00 UTC (rev 274208)
+++ trunk/Tools/ChangeLog	2021-03-10 12:52:34 UTC (rev 274209)
@@ -1,3 +1,17 @@
+2021-03-10  Aakash Jain  <[email protected]>
+
+        [build.webkit.org] Update RunJavaScriptCoreTests step for new buildbot
+        https://bugs.webkit.org/show_bug.cgi?id=223011
+
+        Reviewed by Dewei Zhu.
+
+        * CISupport/build-webkit-org/steps.py:
+        (RunJavaScriptCoreTests.start): Used logobserver.
+        (RunJavaScriptCoreTests.countFailures):
+        * CISupport/build-webkit-org/steps_unittest.py:
+        (TestRunJavaScriptCoreTests.test_success): Added unit-test.
+        (TestRunJavaScriptCoreTests.test_failure): Ditto.
+
 2021-03-10  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r274166.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to