Title: [277043] trunk/Tools
Revision
277043
Author
aakash_j...@apple.com
Date
2021-05-05 14:52:35 -0700 (Wed, 05 May 2021)

Log Message

[build.webkit.org] Add a build step to set appropriate permissions on uploaded test results
https://bugs.webkit.org/show_bug.cgi?id=225415

Reviewed by Dewei Zhu.

* CISupport/build-webkit-org/factories.py:
(TestFactory.__init__): Added the build-step.
* CISupport/build-webkit-org/steps.py:
(ExtractTestResults.resultDirectoryURL):
(SetPermissions): Build step to set permissions on uploaded test result directory.

Modified Paths

Diff

Modified: trunk/Tools/CISupport/build-webkit-org/factories.py (277042 => 277043)


--- trunk/Tools/CISupport/build-webkit-org/factories.py	2021-05-05 21:33:04 UTC (rev 277042)
+++ trunk/Tools/CISupport/build-webkit-org/factories.py	2021-05-05 21:52:35 UTC (rev 277043)
@@ -114,6 +114,7 @@
             self.addStep(ArchiveTestResults())
             self.addStep(UploadTestResults())
             self.addStep(ExtractTestResults())
+            self.addStep(SetPermissions())
         if platform == "gtk":
             self.addStep(RunGtkAPITests())
             if additionalArguments and "--display-server=wayland" in additionalArguments:

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


--- trunk/Tools/CISupport/build-webkit-org/steps.py	2021-05-05 21:33:04 UTC (rev 277042)
+++ trunk/Tools/CISupport/build-webkit-org/steps.py	2021-05-05 21:52:35 UTC (rev 277043)
@@ -1117,6 +1117,7 @@
         master.MasterShellCommand.__init__(self, **kwargs)
 
     def resultDirectoryURL(self):
+        self.setProperty('result_directory', self.resultDirectory)
         return self.resultDirectory.replace('public_html/', '/') + '/'
 
     def addCustomURLs(self):
@@ -1128,6 +1129,16 @@
         return master.MasterShellCommand.finished(self, result)
 
 
+class SetPermissions(master.MasterShellCommand):
+    name = 'set-permissions'
+
+    def __init__(self, **kwargs):
+        resultDirectory = Interpolate('%(prop:result_directory)s')
+        kwargs['command'] = ['chmod', 'a+rx', resultDirectory]
+        kwargs['logEnviron'] = False
+        master.MasterShellCommand.__init__(self, **kwargs)
+
+
 class ShowIdentifier(shell.ShellCommand):
     name = 'show-identifier'
     identifier_re = '^Identifier: (.*)$'

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


--- trunk/Tools/CISupport/build-webkit-org/steps_unittest.py	2021-05-05 21:33:04 UTC (rev 277042)
+++ trunk/Tools/CISupport/build-webkit-org/steps_unittest.py	2021-05-05 21:52:35 UTC (rev 277043)
@@ -962,3 +962,32 @@
         )
         self.expectOutcome(result=FAILURE, state_string='9 JSC tests failed')
         return self.runStep()
+
+
+class TestSetPermissions(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        return self.tearDownBuildStep()
+
+    def test_success(self):
+        self.setupStep(SetPermissions())
+        self.setProperty('result_directory', 'public_html/results/Apple-BigSur-Release-WK2-Tests/r277034 (2346)')
+        self.expectLocalCommands(
+            ExpectMasterShellCommand(command=['chmod', 'a+rx', 'public_html/results/Apple-BigSur-Release-WK2-Tests/r277034 (2346)'])
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Ran')
+        return self.runStep()
+
+    def test_failure(self):
+        self.setupStep(SetPermissions())
+        self.setProperty('result_directory', 'testdir')
+        self.expectLocalCommands(
+            ExpectMasterShellCommand(command=['chmod', 'a+rx', 'testdir'])
+            + 1,
+        )
+        self.expectOutcome(result=FAILURE, state_string='failed (1) (failure)')
+        return self.runStep()

Modified: trunk/Tools/ChangeLog (277042 => 277043)


--- trunk/Tools/ChangeLog	2021-05-05 21:33:04 UTC (rev 277042)
+++ trunk/Tools/ChangeLog	2021-05-05 21:52:35 UTC (rev 277043)
@@ -1,3 +1,16 @@
+2021-05-05  Aakash Jain  <aakash_j...@apple.com>
+
+        [build.webkit.org] Add a build step to set appropriate permissions on uploaded test results
+        https://bugs.webkit.org/show_bug.cgi?id=225415
+
+        Reviewed by Dewei Zhu.
+
+        * CISupport/build-webkit-org/factories.py:
+        (TestFactory.__init__): Added the build-step.
+        * CISupport/build-webkit-org/steps.py:
+        (ExtractTestResults.resultDirectoryURL):
+        (SetPermissions): Build step to set permissions on uploaded test result directory.
+
 2021-05-05  Alicia Boya GarcĂ­a  <ab...@igalia.com>
 
         [MSE][GStreamer] WebKitMediaSrc rework v2
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to