Title: [279953] trunk/Tools
Revision
279953
Author
aakash_j...@apple.com
Date
2021-07-15 10:17:23 -0700 (Thu, 15 Jul 2021)

Log Message

Add unit-tests for InstallBuiltProduct step
https://bugs.webkit.org/show_bug.cgi?id=227990

Reviewed by Philippe Normand.

* CISupport/build-webkit-org/steps_unittest.py:
* CISupport/ews-build/steps_unittest.py:

Modified Paths

Diff

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


--- trunk/Tools/CISupport/build-webkit-org/steps_unittest.py	2021-07-15 16:50:41 UTC (rev 279952)
+++ trunk/Tools/CISupport/build-webkit-org/steps_unittest.py	2021-07-15 17:17:23 UTC (rev 279953)
@@ -1283,3 +1283,43 @@
         )
         self.expectOutcome(result=FAILURE, state_string='Failed to print configuration')
         return self.runStep()
+
+
+class TestInstallBuiltProduct(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        return self.tearDownBuildStep()
+
+    def test_success(self):
+        self.setupStep(InstallBuiltProduct())
+        self.setProperty('fullPlatform', 'ios-14')
+        self.setProperty('configuration', 'release')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['python3', 'Tools/Scripts/install-built-product', '--platform=ios-14', '--release'],
+                        logEnviron=True,
+                        timeout=1200,
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Installed Built Product')
+        return self.runStep()
+
+    def test_failure(self):
+        self.setupStep(InstallBuiltProduct())
+        self.setProperty('fullPlatform', 'ios-14')
+        self.setProperty('configuration', 'debug')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['python3', 'Tools/Scripts/install-built-product', '--platform=ios-14', '--debug'],
+                        logEnviron=True,
+                        timeout=1200,
+                        )
+            + ExpectShell.log('stdio', stdout='Unexpected error.')
+            + 2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Installed Built Product (failure)')
+        return self.runStep()

Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (279952 => 279953)


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-07-15 16:50:41 UTC (rev 279952)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-07-15 17:17:23 UTC (rev 279953)
@@ -46,7 +46,8 @@
                    CleanBuild, CleanUpGitIndexLock, CleanGitRepo, CleanWorkingDirectory, CompileJSC, CompileJSCWithoutPatch,
                    CompileWebKit, CompileWebKitWithoutPatch, ConfigureBuild, CreateLocalGITCommit,
                    DownloadBuiltProduct, DownloadBuiltProductFromMaster, EWS_BUILD_HOSTNAME, ExtractBuiltProduct, ExtractTestResults,
-                   FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, GitResetHard, InstallGtkDependencies, InstallWpeDependencies,
+                   FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, GitResetHard,
+                   InstallBuiltProduct, InstallGtkDependencies, InstallWpeDependencies,
                    KillOldProcesses, PrintConfiguration, PushCommitToWebKitRepo, ReRunAPITests, ReRunJavaScriptCoreTests, ReRunWebKitPerlTests,
                    ReRunWebKitTests, RunAPITests, RunAPITestsWithoutPatch, RunBindingsTests, RunBuildWebKitOrgUnitTests,
                    RunBuildbotCheckConfigForBuildWebKit, RunBuildbotCheckConfigForEWS, RunEWSUnitTests, RunResultsdbpyTests,
@@ -4406,5 +4407,45 @@
         return self.runStep()
 
 
+class TestInstallBuiltProduct(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        return self.tearDownBuildStep()
+
+    def test_success(self):
+        self.setupStep(InstallBuiltProduct())
+        self.setProperty('fullPlatform', 'ios-14')
+        self.setProperty('configuration', 'release')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['python3', 'Tools/Scripts/install-built-product', '--platform=ios-14', '--release'],
+                        logEnviron=True,
+                        timeout=1200,
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Installed Built Product')
+        return self.runStep()
+
+    def test_failure(self):
+        self.setupStep(InstallBuiltProduct())
+        self.setProperty('fullPlatform', 'ios-14')
+        self.setProperty('configuration', 'debug')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['python3', 'Tools/Scripts/install-built-product', '--platform=ios-14', '--debug'],
+                        logEnviron=True,
+                        timeout=1200,
+                        )
+            + ExpectShell.log('stdio', stdout='Unexpected error.')
+            + 2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Installed Built Product (failure)')
+        return self.runStep()
+
+
 if __name__ == '__main__':
     unittest.main()

Modified: trunk/Tools/ChangeLog (279952 => 279953)


--- trunk/Tools/ChangeLog	2021-07-15 16:50:41 UTC (rev 279952)
+++ trunk/Tools/ChangeLog	2021-07-15 17:17:23 UTC (rev 279953)
@@ -1,5 +1,15 @@
 2021-07-15  Aakash Jain  <aakash_j...@apple.com>
 
+        Add unit-tests for InstallBuiltProduct step
+        https://bugs.webkit.org/show_bug.cgi?id=227990
+
+        Reviewed by Philippe Normand.
+
+        * CISupport/build-webkit-org/steps_unittest.py:
+        * CISupport/ews-build/steps_unittest.py:
+
+2021-07-15  Aakash Jain  <aakash_j...@apple.com>
+
         [iOS]TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers is failing
         https://bugs.webkit.org/show_bug.cgi?id=227918
         <rdar://problem/80535625>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to