Changeset 245461 in webkit


Ignore:
Timestamp:
May 17, 2019 7:32:17 AM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Add build step to Transfer archive to S3
https://bugs.webkit.org/show_bug.cgi?id=197922

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(TransferToS3):
(TransferToS3.finished): Invoke triggers after transfer is successful.
(TransferToS3.getResultSummary): Create more readable failure string.
(UploadBuiltProduct.finished): Deleted. Moved the trigger invocation after TransferToS3.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-build/steps.py

    r245433 r245461  
    616616            self.build.addStepsAfterCurrentStep([UnApplyPatchIfRequired(), CompileWebKitToT()])
    617617        else:
    618             self.build.addStepsAfterCurrentStep([ArchiveBuiltProduct(), UploadBuiltProduct()])
     618            self.build.addStepsAfterCurrentStep([ArchiveBuiltProduct(), UploadBuiltProduct(), TransferToS3()])
    619619
    620620        return super(CompileWebKit, self).evaluateCommand(cmd)
     
    770770        transfer.FileUpload.__init__(self, **kwargs)
    771771
     772    def getResultSummary(self):
     773        if self.results != SUCCESS:
     774            return {u'step': u'Failed to upload built product'}
     775        return super(UploadBuiltProduct, self).getResultSummary()
     776
     777
     778class TransferToS3(master.MasterShellCommand):
     779    name = 'transfer-to-s3'
     780    description = ['transferring to s3']
     781    descriptionDone = ['Transferred archive to S3']
     782    archive = WithProperties('public_html/archives/%(fullPlatform)s-%(architecture)s-%(configuration)s/%(patch_id)s.zip')
     783    identifier = WithProperties('%(fullPlatform)s-%(architecture)s-%(configuration)s')
     784    patch_id = WithProperties('%(patch_id)s')
     785    command = ['python', '../Shared/transfer-archive-to-s3', '--patch_id', patch_id, '--identifier', identifier, '--archive', archive]
     786    haltOnFailure = True
     787    flunkOnFailure = True
     788
     789    def __init__(self, **kwargs):
     790        kwargs['command'] = self.command
     791        master.MasterShellCommand.__init__(self, logEnviron=False, **kwargs)
     792
    772793    def finished(self, results):
    773794        if results == SUCCESS:
     
    776797                self.build.addStepsAfterCurrentStep([Trigger(schedulerNames=triggers)])
    777798
    778         return super(UploadBuiltProduct, self).finished(results)
     799        return super(TransferToS3, self).finished(results)
    779800
    780801    def getResultSummary(self):
    781802        if self.results != SUCCESS:
    782             return {u'step': u'Failed to upload built product'}
    783         return super(UploadBuiltProduct, self).getResultSummary()
     803            return {u'step': u'Failed to transfer archive to S3'}
     804        return super(TransferToS3, self).getResultSummary()
    784805
    785806
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r245433 r245461  
    4141                   PrintConfiguration, ReRunAPITests, ReRunJavaScriptCoreTests, RunAPITests, RunAPITestsWithoutPatch,
    4242                   RunBindingsTests, RunJavaScriptCoreTests, RunJavaScriptCoreTestsToT, RunWebKit1Tests, RunWebKitPerlTests,
    43                    RunWebKitPyTests, RunWebKitTests, TestWithFailureCount, Trigger, UnApplyPatchIfRequired, UploadBuiltProduct,
    44                    UploadTestResults, ValidatePatch)
     43                   RunWebKitPyTests, RunWebKitTests, TestWithFailureCount, Trigger, TransferToS3, UnApplyPatchIfRequired,
     44                   UploadBuiltProduct, UploadTestResults, ValidatePatch)
    4545
    4646# Workaround for https://github.com/buildbot/buildbot/issues/4669
     
    10711071        )
    10721072        self.expectOutcome(result=FAILURE, state_string='Extracted built product (failure)')
     1073        return self.runStep()
     1074
     1075
     1076class TestTransferToS3(BuildStepMixinAdditions, unittest.TestCase):
     1077    def setUp(self):
     1078        self.longMessage = True
     1079        return self.setUpBuildStep()
     1080
     1081    def tearDown(self):
     1082        return self.tearDownBuildStep()
     1083
     1084    def test_success(self):
     1085        self.setupStep(TransferToS3())
     1086        self.setProperty('fullPlatform', 'mac-highsierra')
     1087        self.setProperty('configuration', 'release')
     1088        self.setProperty('architecture', 'x86_64')
     1089        self.setProperty('patch_id', '1234')
     1090        self.expectLocalCommands(
     1091            ExpectMasterShellCommand(command=['python',
     1092                                              '../Shared/transfer-archive-to-s3',
     1093                                              '--patch_id', '1234',
     1094                                              '--identifier', 'mac-highsierra-x86_64-release',
     1095                                              '--archive', 'public_html/archives/mac-highsierra-x86_64-release/1234.zip',
     1096                                             ])
     1097            + 0,
     1098        )
     1099        self.expectOutcome(result=SUCCESS, state_string='Transferred archive to S3')
     1100        return self.runStep()
     1101
     1102    def test_failure(self):
     1103        self.setupStep(TransferToS3())
     1104        self.setProperty('fullPlatform', 'ios-simulator-12')
     1105        self.setProperty('configuration', 'debug')
     1106        self.setProperty('architecture', 'x86_64')
     1107        self.setProperty('patch_id', '1234')
     1108        self.expectLocalCommands(
     1109            ExpectMasterShellCommand(command=['python',
     1110                                              '../Shared/transfer-archive-to-s3',
     1111                                              '--patch_id', '1234',
     1112                                              '--identifier', 'ios-simulator-12-x86_64-debug',
     1113                                              '--archive', 'public_html/archives/ios-simulator-12-x86_64-debug/1234.zip',
     1114                                             ])
     1115            + 2,
     1116        )
     1117        self.expectOutcome(result=FAILURE, state_string='Failed to transfer archive to S3')
    10731118        return self.runStep()
    10741119
  • trunk/Tools/ChangeLog

    r245460 r245461  
     12019-05-17  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Add build step to Transfer archive to S3
     4        https://bugs.webkit.org/show_bug.cgi?id=197922
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (TransferToS3):
     10        (TransferToS3.finished): Invoke triggers after transfer is successful.
     11        (TransferToS3.getResultSummary): Create more readable failure string.
     12        (UploadBuiltProduct.finished): Deleted. Moved the trigger invocation after TransferToS3.
     13        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
     14
    1152019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
Note: See TracChangeset for help on using the changeset viewer.