Changeset 251450 in webkit


Ignore:
Timestamp:
Oct 22, 2019, 1:40:06 PM (6 years ago)
Author:
aakash_jain@apple.com
Message:

[ews] Download the build archive from master when download from S3 fails
https://bugs.webkit.org/show_bug.cgi?id=203263

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(DownloadBuiltProduct.evaluateCommand):
(DownloadBuiltProductFromMaster): Build step to download the archive from build master.
(DownloadBuiltProductFromMaster.getResultSummary): Added custom failure message.
(DownloadBuiltProductFromMaster.evaluateCommand): Overrided to ensure it doesn't use this method from base
class DownloadBuiltProduct.

  • 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

    r251167 r251450  
    3737BUG_SERVER_URL = 'https://bugs.webkit.org/'
    3838S3URL = 'https://s3-us-west-2.amazonaws.com/'
     39EWS_URL = 'https://ews-build.webkit.org/'
    3940WithProperties = properties.WithProperties
    4041Interpolate = properties.Interpolate
     
    12981299    description = ['downloading built product']
    12991300    descriptionDone = ['Downloaded built product']
    1300     haltOnFailure = True
    1301     flunkOnFailure = True
     1301    flunkOnFailure = False
    13021302
    13031303    def getResultSummary(self):
     
    13081308    def __init__(self, **kwargs):
    13091309        super(DownloadBuiltProduct, self).__init__(logEnviron=False, **kwargs)
     1310
     1311    def evaluateCommand(self, cmd):
     1312        rc = shell.ShellCommand.evaluateCommand(self, cmd)
     1313        if rc == FAILURE:
     1314            self.build.addStepsAfterCurrentStep([DownloadBuiltProductFromMaster()])
     1315        return rc
     1316
     1317
     1318class DownloadBuiltProductFromMaster(DownloadBuiltProduct):
     1319    command = ['python', 'Tools/BuildSlaveSupport/download-built-product',
     1320        WithProperties('--%(configuration)s'),
     1321        WithProperties(EWS_URL + 'archives/%(fullPlatform)s-%(architecture)s-%(configuration)s/%(patch_id)s.zip')]
     1322    haltOnFailure = True
     1323    flunkOnFailure = True
     1324
     1325    def getResultSummary(self):
     1326        if self.results != SUCCESS:
     1327            return {u'step': u'Failed to download built product from build master'}
     1328        return shell.ShellCommand.getResultSummary(self)
     1329
     1330    def evaluateCommand(self, cmd):
     1331        return shell.ShellCommand.evaluateCommand(self, cmd)
    13101332
    13111333
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r251167 r251450  
    3838                   CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, CheckStyle, CleanBuild, CleanUpGitIndexLock, CleanWorkingDirectory,
    3939                   CompileJSC, CompileJSCToT, CompileWebKit, CompileWebKitToT, ConfigureBuild,
    40                    DownloadBuiltProduct, ExtractBuiltProduct, ExtractTestResults, InstallGtkDependencies, InstallWpeDependencies, KillOldProcesses,
     40                   DownloadBuiltProduct, DownloadBuiltProductFromMaster, ExtractBuiltProduct, ExtractTestResults, InstallGtkDependencies, InstallWpeDependencies, KillOldProcesses,
    4141                   PrintConfiguration, ReRunAPITests, ReRunJavaScriptCoreTests, ReRunWebKitTests, RunAPITests, RunAPITestsWithoutPatch,
    4242                   RunBindingsTests, RunBuildWebKitOrgUnitTests, RunEWSBuildbotCheckConfig, RunEWSUnitTests, RunJavaScriptCoreTests, RunJavaScriptCoreTestsToT, RunWebKit1Tests,
     
    17181718        )
    17191719        self.expectOutcome(result=FAILURE, state_string='Failed to download built product from S3')
     1720        return self.runStep()
     1721
     1722
     1723class TestDownloadBuiltProductFromMaster(BuildStepMixinAdditions, unittest.TestCase):
     1724    def setUp(self):
     1725        self.longMessage = True
     1726        return self.setUpBuildStep()
     1727
     1728    def tearDown(self):
     1729        return self.tearDownBuildStep()
     1730
     1731    def test_success(self):
     1732        self.setupStep(DownloadBuiltProductFromMaster())
     1733        self.setProperty('fullPlatform', 'ios-simulator-12')
     1734        self.setProperty('configuration', 'release')
     1735        self.setProperty('architecture', 'x86_64')
     1736        self.setProperty('patch_id', '1234')
     1737        self.expectRemoteCommands(
     1738            ExpectShell(workdir='wkdir',
     1739                        logEnviron=False,
     1740                        command=['python', 'Tools/BuildSlaveSupport/download-built-product', '--release', 'https://ews-build.webkit.org/archives/ios-simulator-12-x86_64-release/1234.zip'],
     1741                        )
     1742            + 0,
     1743        )
     1744        self.expectOutcome(result=SUCCESS, state_string='Downloaded built product')
     1745        return self.runStep()
     1746
     1747    def test_failure(self):
     1748        self.setupStep(DownloadBuiltProductFromMaster())
     1749        self.setProperty('fullPlatform', 'mac-sierra')
     1750        self.setProperty('configuration', 'debug')
     1751        self.setProperty('architecture', 'x86_64')
     1752        self.setProperty('patch_id', '123456')
     1753        self.expectRemoteCommands(
     1754            ExpectShell(workdir='wkdir',
     1755                        logEnviron=False,
     1756                        command=['python', 'Tools/BuildSlaveSupport/download-built-product', '--debug', 'https://ews-build.webkit.org/archives/mac-sierra-x86_64-debug/123456.zip'],
     1757                        )
     1758            + ExpectShell.log('stdio', stdout='Unexpected failure.')
     1759            + 2,
     1760        )
     1761        self.expectOutcome(result=FAILURE, state_string='Failed to download built product from build master')
    17201762        return self.runStep()
    17211763
  • trunk/Tools/ChangeLog

    r251439 r251450  
     12019-10-22  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews] Download the build archive from master when download from S3 fails
     4        https://bugs.webkit.org/show_bug.cgi?id=203263
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (DownloadBuiltProduct.evaluateCommand):
     10        (DownloadBuiltProductFromMaster): Build step to download the archive from build master.
     11        (DownloadBuiltProductFromMaster.getResultSummary): Added custom failure message.
     12        (DownloadBuiltProductFromMaster.evaluateCommand): Overrided to ensure it doesn't use this method from base
     13        class DownloadBuiltProduct.
     14        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
     15
    1162019-10-22  youenn fablet  <youenn@apple.com>
    217
Note: See TracChangeset for help on using the changeset viewer.