Skip to content
Permalink
Browse files
[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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JonWBedard committed Feb 11, 2022
1 parent 816ed11 commit 5d7eeafce9b9d55849543aee002c045e88a1444a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 19 deletions.
@@ -312,7 +312,7 @@ def add_pr_details(self):
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 @@ def __init__(self, identifier='', **kwargs):
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 @@ def __init__(self, identifier=''):
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)
@@ -4203,7 +4203,7 @@ def test_success(self):
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,7 +4214,27 @@ def test_success(self):
+ 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()
@@ -4223,7 +4243,7 @@ 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 @@ def test_success_with_identifier(self):
+ 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,16 +4271,16 @@ def tearDown(self):
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(
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,41 +4291,41 @@ def test_success(self):
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(
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(
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()


@@ -1,3 +1,17 @@
2022-02-10 Jonathan Bedard <jbedard@apple.com>

[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 <kkinnunen@apple.com>

Introduce a RemoteMediaSampleProxy to represent captured video frames used in Media Streams and present in GPUP

0 comments on commit 5d7eeaf

Please sign in to comment.