Title: [289625] trunk/Tools
Revision
289625
Author
[email protected]
Date
2022-02-11 09:23:17 -0800 (Fri, 11 Feb 2022)

Log Message

[EWS] Support PRs in UploadTestResults and ExtractTestResults
https://bugs.webkit.org/show_bug.cgi?id=236446
<rdar://problem/88756592>

Reviewed by Aakash Jain.

* CISupport/ews-build/steps.py:
(ConfigureBuild.add_pr_details): Shorten hash to 8 characters.
(UploadTestResults.__init__): Use change_id instead of patch_id.
(ExtractTestResults.__init__): Ditto.
* CISupport/ews-build/steps_unittest.py:

Canonical link: https://commits.webkit.org/247136@main

Modified Paths

Diff

Modified: trunk/Tools/CISupport/ews-build/steps.py (289624 => 289625)


--- trunk/Tools/CISupport/ews-build/steps.py	2022-02-11 17:11:00 UTC (rev 289624)
+++ trunk/Tools/CISupport/ews-build/steps.py	2022-02-11 17:23:17 UTC (rev 289625)
@@ -312,7 +312,7 @@
         owners = self.getProperty('owners', [])
         revision = self.getProperty('github.head.sha')
 
-        self.setProperty('change_id', revision, 'ConfigureBuild')
+        self.setProperty('change_id', revision[:HASH_LENGTH_TO_DISPLAY], 'ConfigureBuild')
 
         if title:
             self.addURL('PR {}: {}'.format(pr_number, title), GitHub.pr_url(pr_number, repository_url))
@@ -3763,7 +3763,7 @@
         if identifier and not identifier.startswith('-'):
             identifier = '-{}'.format(identifier)
         kwargs['workersrc'] = self.workersrc
-        kwargs['masterdest'] = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s{}.zip'.format(identifier))
+        kwargs['masterdest'] = Interpolate('public_html/results/%(prop:buildername)s/%(prop:change_id)s-%(prop:buildnumber)s{}.zip'.format(identifier))
         kwargs['mode'] = 0o0644
         kwargs['blocksize'] = 1024 * 256
         transfer.FileUpload.__init__(self, **kwargs)
@@ -3780,8 +3780,8 @@
         if identifier and not identifier.startswith('-'):
             identifier = '-{}'.format(identifier)
 
-        self.zipFile = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s{}.zip'.format(identifier))
-        self.resultDirectory = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s{}'.format(identifier))
+        self.zipFile = Interpolate('public_html/results/%(prop:buildername)s/%(prop:change_id)s-%(prop:buildnumber)s{}.zip'.format(identifier))
+        self.resultDirectory = Interpolate('public_html/results/%(prop:buildername)s/%(prop:change_id)s-%(prop:buildnumber)s{}'.format(identifier))
         self.command = ['unzip', '-q', '-o', self.zipFile, '-d', self.resultDirectory]
 
         master.MasterShellCommand.__init__(self, command=self.command, logEnviron=False)

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


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2022-02-11 17:11:00 UTC (rev 289624)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2022-02-11 17:23:17 UTC (rev 289625)
@@ -4203,7 +4203,7 @@
         self.setupStep(UploadTestResults())
         self.setProperty('configuration', 'release')
         self.setProperty('architecture', 'x86_64')
-        self.setProperty('patch_id', '1234')
+        self.setProperty('change_id', '1234')
         self.setProperty('buildername', 'macOS-Sierra-Release-WK2-Tests-EWS')
         self.setProperty('buildnumber', '12')
         self.expectHidden(False)
@@ -4214,16 +4214,36 @@
             + Expect.behavior(uploadFileWithContentsOfString('Dummy zip file content.'))
             + 0,
         )
-        self.expectUploadedFile('public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12.zip')
+        self.expectUploadedFile('public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/1234-12.zip')
 
         self.expectOutcome(result=SUCCESS, state_string='Uploaded test results')
         return self.runStep()
 
+    def test_success_hash(self):
+        self.setupStep(UploadTestResults())
+        self.setProperty('configuration', 'release')
+        self.setProperty('architecture', 'x86_64')
+        self.setProperty('change_id', '8f75a5fa')
+        self.setProperty('buildername', 'macOS-Sierra-Release-WK2-Tests-EWS')
+        self.setProperty('buildnumber', '12')
+        self.expectHidden(False)
+        self.expectRemoteCommands(
+            Expect('uploadFile', dict(workersrc='layout-test-results.zip', workdir='wkdir',
+                                      blocksize=1024 * 256, maxsize=None, keepstamp=False,
+                                      writer=ExpectRemoteRef(remotetransfer.FileWriter)))
+            + Expect.behavior(uploadFileWithContentsOfString('Dummy zip file content.'))
+            + 0,
+        )
+        self.expectUploadedFile('public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/8f75a5fa-12.zip')
+
+        self.expectOutcome(result=SUCCESS, state_string='Uploaded test results')
+        return self.runStep()
+
     def test_success_with_identifier(self):
         self.setupStep(UploadTestResults(identifier='clean-tree'))
         self.setProperty('configuration', 'release')
         self.setProperty('architecture', 'x86_64')
-        self.setProperty('patch_id', '271211')
+        self.setProperty('change_id', '37be32c5')
         self.setProperty('buildername', 'iOS-12-Simulator-WK2-Tests-EWS')
         self.setProperty('buildnumber', '120')
         self.expectHidden(False)
@@ -4234,7 +4254,7 @@
             + Expect.behavior(uploadFileWithContentsOfString('Dummy zip file content.'))
             + 0,
         )
-        self.expectUploadedFile('public_html/results/iOS-12-Simulator-WK2-Tests-EWS/r271211-120-clean-tree.zip')
+        self.expectUploadedFile('public_html/results/iOS-12-Simulator-WK2-Tests-EWS/37be32c5-120-clean-tree.zip')
 
         self.expectOutcome(result=SUCCESS, state_string='Uploaded test results')
         return self.runStep()
@@ -4251,7 +4271,7 @@
     def test_success(self):
         self.setupStep(ExtractTestResults())
         self.setProperty('configuration', 'release')
-        self.setProperty('patch_id', '1234')
+        self.setProperty('change_id', '1234')
         self.setProperty('buildername', 'macOS-Sierra-Release-WK2-Tests-EWS')
         self.setProperty('buildnumber', '12')
         self.expectLocalCommands(
@@ -4258,9 +4278,9 @@
             ExpectMasterShellCommand(command=['unzip',
                                               '-q',
                                               '-o',
-                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12.zip',
+                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/1234-12.zip',
                                               '-d',
-                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12',
+                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/1234-12',
                                               ])
             + 0,
         )
@@ -4271,7 +4291,7 @@
     def test_success_with_identifier(self):
         self.setupStep(ExtractTestResults(identifier='rerun'))
         self.setProperty('configuration', 'release')
-        self.setProperty('patch_id', '1234')
+        self.setProperty('change_id', '1234')
         self.setProperty('buildername', 'iOS-12-Simulator-WK2-Tests-EWS')
         self.setProperty('buildnumber', '12')
         self.expectLocalCommands(
@@ -4278,20 +4298,20 @@
             ExpectMasterShellCommand(command=['unzip',
                                               '-q',
                                               '-o',
-                                              'public_html/results/iOS-12-Simulator-WK2-Tests-EWS/r1234-12-rerun.zip',
+                                              'public_html/results/iOS-12-Simulator-WK2-Tests-EWS/1234-12-rerun.zip',
                                               '-d',
-                                              'public_html/results/iOS-12-Simulator-WK2-Tests-EWS/r1234-12-rerun',
+                                              'public_html/results/iOS-12-Simulator-WK2-Tests-EWS/1234-12-rerun',
                                               ])
             + 0,
         )
         self.expectOutcome(result=SUCCESS, state_string='Extracted test results')
-        self.expectAddedURLs([call('view layout test results', 'https://ews-build.s3-us-west-2.amazonaws.com/iOS-12-Simulator-WK2-Tests-EWS/r1234-12/results.html')])
+        self.expectAddedURLs([call('view layout test results', 'https://ews-build.s3-us-west-2.amazonaws.com/iOS-12-Simulator-WK2-Tests-EWS/1234-12/results.html')])
         return self.runStep()
 
     def test_failure(self):
         self.setupStep(ExtractTestResults())
         self.setProperty('configuration', 'debug')
-        self.setProperty('patch_id', '1234')
+        self.setProperty('change_id', '1234')
         self.setProperty('buildername', 'macOS-Sierra-Release-WK2-Tests-EWS')
         self.setProperty('buildnumber', '12')
         self.expectLocalCommands(
@@ -4298,14 +4318,14 @@
             ExpectMasterShellCommand(command=['unzip',
                                               '-q',
                                               '-o',
-                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12.zip',
+                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/1234-12.zip',
                                               '-d',
-                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12',
+                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/1234-12',
                                               ])
             + 2,
         )
         self.expectOutcome(result=FAILURE, state_string='failed (2) (failure)')
-        self.expectAddedURLs([call('view layout test results', 'https://ews-build.s3-us-west-2.amazonaws.com/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12/results.html')])
+        self.expectAddedURLs([call('view layout test results', 'https://ews-build.s3-us-west-2.amazonaws.com/macOS-Sierra-Release-WK2-Tests-EWS/1234-12/results.html')])
         return self.runStep()
 
 

Modified: trunk/Tools/ChangeLog (289624 => 289625)


--- trunk/Tools/ChangeLog	2022-02-11 17:11:00 UTC (rev 289624)
+++ trunk/Tools/ChangeLog	2022-02-11 17:23:17 UTC (rev 289625)
@@ -1,3 +1,17 @@
+2022-02-10  Jonathan Bedard  <[email protected]>
+
+        [EWS] Support PRs in UploadTestResults and ExtractTestResults
+        https://bugs.webkit.org/show_bug.cgi?id=236446
+        <rdar://problem/88756592>
+
+        Reviewed by Aakash Jain.
+
+        * CISupport/ews-build/steps.py:
+        (ConfigureBuild.add_pr_details): Shorten hash to 8 characters.
+        (UploadTestResults.__init__): Use change_id instead of patch_id.
+        (ExtractTestResults.__init__): Ditto.
+        * CISupport/ews-build/steps_unittest.py:
+
 2022-02-11  Kimmo Kinnunen  <[email protected]>
 
         Introduce a RemoteMediaSampleProxy to represent captured video frames used in Media Streams and present in GPUP
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to