[ews-build] Add build step ArchiveBuiltProduct
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2018 23:03:21 +0000 (23:03 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2018 23:03:21 +0000 (23:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188014

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(ArchiveBuiltProduct): Added build step ArchiveBuiltProduct.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

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

index 467a4c2..125e843 100644 (file)
@@ -284,3 +284,12 @@ class RunWebKitTests(shell.Test):
         if additionalArguments:
             self.setCommand(self.command + additionalArguments)
         return shell.Test.start(self)
+
+
+class ArchiveBuiltProduct(shell.ShellCommand):
+    command = ['python', 'Tools/BuildSlaveSupport/built-product-archive',
+               WithProperties('--platform=%(fullPlatform)s'), WithProperties('--%(configuration)s'), 'archive']
+    name = 'archive-built-product'
+    description = ['archiving built product']
+    descriptionDone = ['archived built product']
+    haltOnFailure = True
index 69caede..575728a 100644 (file)
@@ -745,5 +745,41 @@ class TestRunWebKitTests(BuildStepMixinAdditions, unittest.TestCase):
         return self.runStep()
 
 
+class TestArchiveBuiltProduct(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        return self.tearDownBuildStep()
+
+    def test_success(self):
+        self.setupStep(ArchiveBuiltProduct())
+        self.setProperty('fullPlatform', 'ios-simulator')
+        self.setProperty('configuration', 'release')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['python', 'Tools/BuildSlaveSupport/built-product-archive', '--platform=ios-simulator',  '--release', 'archive'],
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='archived built product')
+        return self.runStep()
+
+    def test_failure(self):
+        self.setupStep(ArchiveBuiltProduct())
+        self.setProperty('fullPlatform', 'mac-sierra')
+        self.setProperty('configuration', 'debug')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['python', 'Tools/BuildSlaveSupport/built-product-archive', '--platform=mac-sierra',  '--debug', 'archive'],
+                        )
+            + ExpectShell.log('stdio', stdout='Unexpected failure.')
+            + 2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='archived built product (failure)')
+        return self.runStep()
+
+
 if __name__ == '__main__':
     unittest.main()
index 0252898..6cb87d2 100644 (file)
@@ -1,3 +1,14 @@
+2018-07-25  Aakash Jain  <aakash_jain@apple.com>
+
+        [ews-build] Add build step ArchiveBuiltProduct
+        https://bugs.webkit.org/show_bug.cgi?id=188014
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (ArchiveBuiltProduct): Added build step ArchiveBuiltProduct.
+        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
+
 2018-07-25  Chris Dumez  <cdumez@apple.com>
 
         navigator.userAgent may return outdated value after webView.customUserAgent is set