[ews-build] API tests should output result summary in json
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2018 18:49:23 +0000 (18:49 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2018 18:49:23 +0000 (18:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189417

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(RunAPITests): Passed --json-output parameter to run-api-tests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235789 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/ews-build/steps.py
Tools/BuildSlaveSupport/ews-build/steps_unittest.py
Tools/ChangeLog

index 5f9a958..a1407c6 100644 (file)
@@ -479,7 +479,10 @@ class RunAPITests(TestWithFailureCount):
     name = 'run-api-tests'
     description = ['api tests running']
     descriptionDone = ['api-tests']
-    command = ['python', 'Tools/Scripts/run-api-tests', '--no-build', WithProperties('--%(configuration)s'), '--verbose']
+    jsonFileName = 'api_test_results.json'
+    logfiles = {'json': jsonFileName}
+    command = ['python', 'Tools/Scripts/run-api-tests', '--no-build',
+               WithProperties('--%(configuration)s'), '--verbose', '--json-output={0}'.format(jsonFileName)]
     failedTestsFormatString = '%d api test%s failed or timed out'
 
     def start(self):
index e08faca..e3a7afd 100644 (file)
@@ -928,6 +928,7 @@ class TestExtractBuiltProduct(BuildStepMixinAdditions, unittest.TestCase):
 class TestRunAPITests(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True
+        self.jsonFileName = 'api_test_results.json'
         return self.setUpBuildStep()
 
     def tearDown(self):
@@ -941,7 +942,8 @@ class TestRunAPITests(BuildStepMixinAdditions, unittest.TestCase):
 
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
-                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--release', '--verbose'],
+                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--release', '--verbose', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
                         )
             + ExpectShell.log('stdio', stdout='''...
 worker/0 TestWTF.WTF_Variant.OperatorAmpersand Passed
@@ -967,7 +969,8 @@ All tests successfully passed!
 
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
-                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose', '--ios-simulator'],
+                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose', '--json-output={0}'.format(self.jsonFileName), '--ios-simulator'],
+                        logfiles={'json': self.jsonFileName},
                         )
             + ExpectShell.log('stdio', stdout='''...
 worker/0 TestWTF.WTF_Variant.OperatorAmpersand Passed
@@ -993,7 +996,8 @@ All tests successfully passed!
 
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
-                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose'],
+                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
                         )
             + ExpectShell.log('stdio', stdout='''
 worker/0 TestWTF.WTF_Variant.OperatorAmpersand Passed
@@ -1033,7 +1037,8 @@ Testing completed, Exit status: 3
 
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
-                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose'],
+                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
                         )
             + ExpectShell.log('stdio', stdout='''...
 worker/0 TestWTF.WTF_Variant.OperatorAmpersand Passed
@@ -1087,7 +1092,8 @@ Testing completed, Exit status: 3
 
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
-                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose'],
+                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
                         )
             + ExpectShell.log('stdio', stdout='Unexpected failure. Failed to run api tests.')
             + 2,
@@ -1103,7 +1109,8 @@ Testing completed, Exit status: 3
 
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
-                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose'],
+                        command=['python', 'Tools/Scripts/run-api-tests', '--no-build', '--debug', '--verbose', '--json-output={0}'.format(self.jsonFileName)],
+                        logfiles={'json': self.jsonFileName},
                         )
             + ExpectShell.log('stdio', stdout='''...
 worker/0 TestWTF.WTF_Variant.OperatorAmpersand Passed
index 400c797..f32b77f 100644 (file)
@@ -1,3 +1,14 @@
+2018-09-07  Aakash Jain  <aakash_jain@apple.com>
+
+        [ews-build] API tests should output result summary in json
+        https://bugs.webkit.org/show_bug.cgi?id=189417
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (RunAPITests): Passed --json-output parameter to run-api-tests.
+        * BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.
+
 2018-09-07  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r235784.