Changeset 275624 in webkit


Ignore:
Timestamp:
Apr 7, 2021 2:00:24 PM (3 years ago)
Author:
aakash_jain@apple.com
Message:

commit-queue should perform git reset --hard between retry attempts
https://bugs.webkit.org/show_bug.cgi?id=224300

Reviewed by Jonathan Bedard.

  • CISupport/ews-build/steps.py:

(GitResetHard): Build step to perform git reset --hard.
(GitResetHard.start):
(PushCommitToWebKitRepo.evaluateCommand):

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

Legend:

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

    r275613 r275624  
    167167    def start(self):
    168168        self.setCommand(['git', 'checkout', self.getProperty('ews_revision')])
     169        return shell.ShellCommand.start(self)
     170
     171
     172class GitResetHard(shell.ShellCommand):
     173    name = 'git-reset-hard'
     174    descriptionDone = ['Performed git reset --hard']
     175
     176    def __init__(self, **kwargs):
     177        super(GitResetHard, self).__init__(logEnviron=False, **kwargs)
     178
     179    def start(self):
     180        self.setCommand(['git', 'reset', 'HEAD~10', '--hard'])
    169181        return shell.ShellCommand.start(self)
    170182
     
    32723284            if retry_count < self.MAX_RETRY:
    32733285                self.setProperty('retry_count', retry_count + 1)
    3274                 self.build.addStepsAfterCurrentStep([CheckOutSource(), ShowIdentifier(), UpdateWorkingDirectory(), ApplyPatch(), CreateLocalGITCommit(), PushCommitToWebKitRepo()])
     3286                self.build.addStepsAfterCurrentStep([GitResetHard(), CheckOutSource(), ShowIdentifier(), UpdateWorkingDirectory(), ApplyPatch(), CreateLocalGITCommit(), PushCommitToWebKitRepo()])
    32753287                return rc
    32763288
  • trunk/Tools/CISupport/ews-build/steps_unittest.py

    r275613 r275624  
    4747                   CompileWebKitWithoutPatch, ConfigureBuild, CreateLocalGITCommit,
    4848                   DownloadBuiltProduct, DownloadBuiltProductFromMaster, EWS_BUILD_HOSTNAME, ExtractBuiltProduct, ExtractTestResults,
    49                    FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, InstallGtkDependencies, InstallWpeDependencies,
     49                   FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, GitResetHard, InstallGtkDependencies, InstallWpeDependencies,
    5050                   KillOldProcesses, PrintConfiguration, PushCommitToWebKitRepo, ReRunAPITests, ReRunJavaScriptCoreTests, ReRunWebKitPerlTests,
    5151                   ReRunWebKitTests, RunAPITests, RunAPITestsWithoutPatch, RunBindingsTests, RunBuildWebKitOrgUnitTests,
     
    837837        )
    838838        self.expectOutcome(result=FAILURE, state_string='Failed to kill old processes')
     839        return self.runStep()
     840
     841
     842class TestGitResetHard(BuildStepMixinAdditions, unittest.TestCase):
     843    def setUp(self):
     844        self.longMessage = True
     845        return self.setUpBuildStep()
     846
     847    def tearDown(self):
     848        return self.tearDownBuildStep()
     849
     850    def test_success(self):
     851        self.setupStep(GitResetHard())
     852        self.expectRemoteCommands(
     853            ExpectShell(workdir='wkdir',
     854                        command=['git', 'reset', 'HEAD~10', '--hard'],
     855                        logEnviron=False,
     856                        )
     857            + 0,
     858        )
     859        self.expectOutcome(result=SUCCESS, state_string='Performed git reset --hard')
     860        return self.runStep()
     861
     862    def test_failure(self):
     863        self.setupStep(GitResetHard())
     864        self.expectRemoteCommands(
     865            ExpectShell(workdir='wkdir',
     866                        command=['git', 'reset', 'HEAD~10', '--hard'],
     867                        logEnviron=False,
     868                        )
     869            + ExpectShell.log('stdio', stdout='Unexpected error.')
     870            + 2,
     871        )
     872        self.expectOutcome(result=FAILURE, state_string='Performed git reset --hard (failure)')
    839873        return self.runStep()
    840874
  • trunk/Tools/ChangeLog

    r275613 r275624  
     12021-04-07  Aakash Jain  <aakash_jain@apple.com>
     2
     3        commit-queue should perform git reset --hard between retry attempts
     4        https://bugs.webkit.org/show_bug.cgi?id=224300
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * CISupport/ews-build/steps.py:
     9        (GitResetHard): Build step to perform git reset --hard.
     10        (GitResetHard.start):
     11        (PushCommitToWebKitRepo.evaluateCommand):
     12        * CISupport/ews-build/steps_unittest.py: Added unit-test.
     13
    1142021-04-07  Jonathan Bedard  <jbedard@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.