Changeset 246651 in webkit


Ignore:
Timestamp:
Jun 20, 2019 1:35:57 PM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Triggered builds should use same revision as parent build
https://bugs.webkit.org/show_bug.cgi?id=198289

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(CheckOutSpecificRevision): Build step to checkout specific revision.
(CheckOutSpecificRevision.doStepIf): Run this step only if ews_revision property is set.
(CheckOutSpecificRevision.hideStepIf): Hide this step when it is skipped.
(CheckOutSpecificRevision.start): Run appropriate git command.
(Trigger.propertiesToPassToTriggers): Pass ews_revision property to triggered builds, so that triggered
builds use same revision as parent build.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
  • BuildSlaveSupport/ews-build/factories.py:

(Factory.init): Added CheckOutSpecificRevision step.

Location:
trunk/Tools
Files:
4 edited

Legend:

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

    r244549 r246651  
    2525from buildbot.steps import trigger
    2626
    27 from steps import (ApplyPatch, CheckOutSource, CheckPatchRelevance, CheckStyle,
    28                    CompileJSCOnly, CompileJSCOnlyToT, CompileWebKit, ConfigureBuild,
     27from steps import (ApplyPatch, CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance,
     28                   CheckStyle, CompileJSCOnly, CompileJSCOnlyToT, CompileWebKit, ConfigureBuild,
    2929                   DownloadBuiltProduct, ExtractBuiltProduct, KillOldProcesses,
    3030                   PrintConfiguration, ReRunJavaScriptCoreTests, RunAPITests, RunBindingsTests,
     
    4242        self.addStep(PrintConfiguration())
    4343        self.addStep(CheckOutSource())
     44        # CheckOutSource step pulls the latest revision, since we use alwaysUseLatest=True. Without alwaysUseLatest Buildbot will
     45        # automatically apply the patch to the repo, and that doesn't handle ChangeLogs well. See https://webkit.org/b/193138
     46        # Therefore we add CheckOutSpecificRevision step to checkout required revision.
     47        self.addStep(CheckOutSpecificRevision())
    4448        self.addStep(ApplyPatch())
    4549
  • trunk/Tools/BuildSlaveSupport/ews-build/steps.py

    r246613 r246651  
    108108
    109109
     110class CheckOutSpecificRevision(shell.ShellCommand):
     111    name = 'checkout-specific-revision'
     112    descriptionDone = ['Checked out required revision']
     113    flunkOnFailure = False
     114    haltOnFailure = False
     115
     116    def doStepIf(self, step):
     117        return self.getProperty('ews_revision', False)
     118
     119    def hideStepIf(self, results, step):
     120        return not self.doStepIf(step)
     121
     122    def start(self):
     123        self.setCommand(['git', 'checkout', self.getProperty('ews_revision')])
     124        return shell.ShellCommand.start(self)
     125
     126
    110127class CleanWorkingDirectory(shell.ShellCommand):
    111128    name = 'clean-working-directory'
     
    405422            'architecture': properties.Property('architecture'),
    406423            'owner': properties.Property('owner'),
     424            'ews_revision': properties.Property('got_revision'),
    407425        }
    408426
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r246650 r246651  
    3636
    3737from steps import (AnalyzeAPITestsResults, AnalyzeCompileWebKitResults, ApplyPatch, ArchiveBuiltProduct, ArchiveTestResults,
    38                    CheckOutSource, CheckPatchRelevance, CheckStyle, CleanBuild, CleanWorkingDirectory,
     38                   CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, CheckStyle, CleanBuild, CleanWorkingDirectory,
    3939                   CompileJSCOnly, CompileJSCOnlyToT, CompileWebKit, CompileWebKitToT, ConfigureBuild,
    4040                   DownloadBuiltProduct, ExtractBuiltProduct, ExtractTestResults, KillOldProcesses,
     
    868868        )
    869869        self.expectOutcome(result=FAILURE, state_string='layout-tests (failure)')
     870        return self.runStep()
     871
     872
     873class TestCheckOutSpecificRevision(BuildStepMixinAdditions, unittest.TestCase):
     874    def setUp(self):
     875        self.longMessage = True
     876        return self.setUpBuildStep()
     877
     878    def tearDown(self):
     879        return self.tearDownBuildStep()
     880
     881    def test_success(self):
     882        self.setupStep(CheckOutSpecificRevision())
     883        self.setProperty('ews_revision', '1a3425cb92dbcbca12a10aa9514f1b77c76dc26')
     884        self.expectHidden(False)
     885        self.expectRemoteCommands(
     886            ExpectShell(workdir='wkdir',
     887                        timeout=1200,
     888                        command=['git', 'checkout', '1a3425cb92dbcbca12a10aa9514f1b77c76dc26'],
     889                        )
     890            + 0,
     891        )
     892        self.expectOutcome(result=SUCCESS, state_string='Checked out required revision')
     893        return self.runStep()
     894
     895    def test_failure(self):
     896        self.setupStep(CheckOutSpecificRevision())
     897        self.setProperty('ews_revision', '1a3425cb92dbcbca12a10aa9514f1b77c76dc26')
     898        self.expectHidden(False)
     899        self.expectRemoteCommands(
     900            ExpectShell(workdir='wkdir',
     901                        timeout=1200,
     902                        command=['git', 'checkout', '1a3425cb92dbcbca12a10aa9514f1b77c76dc26'],
     903                        )
     904            + ExpectShell.log('stdio', stdout='Unexpected failure')
     905            + 2,
     906        )
     907        self.expectOutcome(result=FAILURE, state_string='Checked out required revision (failure)')
     908        return self.runStep()
     909
     910    def test_skip(self):
     911        self.setupStep(CheckOutSpecificRevision())
     912        self.expectHidden(True)
     913        self.expectOutcome(result=SKIPPED, state_string='Checked out required revision (skipped)')
    870914        return self.runStep()
    871915
  • trunk/Tools/ChangeLog

    r246650 r246651  
     12019-06-20  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Triggered builds should use same revision as parent build
     4        https://bugs.webkit.org/show_bug.cgi?id=198289
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (CheckOutSpecificRevision): Build step to checkout specific revision.
     10        (CheckOutSpecificRevision.doStepIf): Run this step only if ews_revision property is set.
     11        (CheckOutSpecificRevision.hideStepIf): Hide this step when it is skipped.
     12        (CheckOutSpecificRevision.start): Run appropriate git command.
     13        (Trigger.propertiesToPassToTriggers): Pass ews_revision property to triggered builds, so that triggered
     14        builds use same revision as parent build.
     15        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
     16        * BuildSlaveSupport/ews-build/factories.py:
     17        (Factory.__init__): Added CheckOutSpecificRevision step.
     18
    1192019-06-20  Aakash Jain  <aakash_jain@apple.com>
    220
Note: See TracChangeset for help on using the changeset viewer.