Changeset 275853 in webkit
- Timestamp:
- Apr 12, 2021 5:48:17 PM (3 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/CISupport/ews-build/factories.py
r275307 r275853 26 26 27 27 from steps import (ApplyPatch, ApplyWatchList, CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, 28 CheckPatchStatusOnEWSQueues, CheckStyle, C ompileJSC, CompileWebKit, ConfigureBuild, CreateLocalGITCommit,28 CheckPatchStatusOnEWSQueues, CheckStyle, CleanGitRepo, CompileJSC, CompileWebKit, ConfigureBuild, CreateLocalGITCommit, 29 29 DownloadBuiltProduct, ExtractBuiltProduct, FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, 30 30 InstallGtkDependencies, InstallWpeDependencies, KillOldProcesses, PrintConfiguration, PushCommitToWebKitRepo, … … 282 282 self.addStep(ValidateCommiterAndReviewer()) 283 283 self.addStep(PrintConfiguration()) 284 self.addStep(CleanGitRepo()) 284 285 self.addStep(CheckOutSource()) 285 286 self.addStep(FetchBranches()) -
trunk/Tools/CISupport/ews-build/factories_unittest.py
r275307 r275853 412 412 _BuildStepFactory(steps.ValidateCommiterAndReviewer), 413 413 _BuildStepFactory(steps.PrintConfiguration), 414 _BuildStepFactory(steps.CleanGitRepo), 414 415 _BuildStepFactory(steps.CheckOutSource), 415 416 _BuildStepFactory(steps.FetchBranches), -
trunk/Tools/CISupport/ews-build/steps.py
r275795 r275853 3129 3129 3130 3130 3131 class CleanGitRepo(steps.ShellSequence): 3132 name = 'clean-up-git-repo' 3133 haltOnFailure = False 3134 flunkOnFailure = False 3135 logEnviron = False 3136 # This somewhat quirky sequence of steps seems to clear up all the broken 3137 # git situations we've gotten ourself into in the past. 3138 command_list = [['git', 'clean', '-f'], # Remove any left-over layout test results, added files, etc. 3139 ['git', 'fetch', 'origin'], # Avoid updating the working copy to a stale revision. 3140 ['git', 'checkout', 'origin/main', '-f'], 3141 ['git', 'branch', '-D', 'main'], 3142 ['git', 'checkout', 'origin/main', '-b', 'main']] 3143 3144 def run(self): 3145 self.commands = [] 3146 for command in self.command_list: 3147 self.commands.append(util.ShellArg(command=command, logname='stdio')) 3148 return super(CleanGitRepo, self).run() 3149 3150 def getResultSummary(self): 3151 if self.results != SUCCESS: 3152 return {'step': 'Encountered some issues during cleanup'} 3153 return {'step': 'Cleaned up git repository'} 3154 3155 3131 3156 class ApplyWatchList(shell.ShellCommand): 3132 3157 name = 'apply-watch-list' -
trunk/Tools/CISupport/ews-build/steps_unittest.py
r275795 r275853 44 44 AnalyzeLayoutTestsResults, ApplyPatch, ApplyWatchList, ArchiveBuiltProduct, ArchiveTestResults, 45 45 CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, CheckPatchStatusOnEWSQueues, CheckStyle, 46 CleanBuild, CleanUpGitIndexLock, Clean WorkingDirectory, CompileJSC, CompileJSCWithoutPatch, CompileWebKit,47 CompileWebKit WithoutPatch, ConfigureBuild, CreateLocalGITCommit,46 CleanBuild, CleanUpGitIndexLock, CleanGitRepo, CleanWorkingDirectory, CompileJSC, CompileJSCWithoutPatch, 47 CompileWebKit, CompileWebKitWithoutPatch, ConfigureBuild, CreateLocalGITCommit, 48 48 DownloadBuiltProduct, DownloadBuiltProductFromMaster, EWS_BUILD_HOSTNAME, ExtractBuiltProduct, ExtractTestResults, 49 49 FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, GitResetHard, InstallGtkDependencies, InstallWpeDependencies, … … 3890 3890 3891 3891 3892 class TestCleanGitRepo(BuildStepMixinAdditions, unittest.TestCase): 3893 def setUp(self): 3894 self.longMessage = True 3895 return self.setUpBuildStep() 3896 3897 def tearDown(self): 3898 return self.tearDownBuildStep() 3899 3900 def test_success(self): 3901 self.setupStep(CleanGitRepo()) 3902 self.setProperty('buildername', 'Commit-Queue') 3903 3904 self.expectRemoteCommands( 3905 ExpectShell(command=['git', 'clean', '-f'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3906 + ExpectShell.log('stdio', stdout=''), 3907 ExpectShell(command=['git', 'fetch', 'origin'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3908 + ExpectShell.log('stdio', stdout=''), 3909 ExpectShell(command=['git', 'checkout', 'origin/main', '-f'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3910 + ExpectShell.log('stdio', stdout='You are in detached HEAD state.'), 3911 ExpectShell(command=['git', 'branch', '-D', 'main'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3912 + ExpectShell.log('stdio', stdout='Deleted branch main (was 57015967fef9).'), 3913 ExpectShell(command=['git', 'checkout', 'origin/main', '-b', 'main'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3914 + ExpectShell.log('stdio', stdout="Switched to a new branch 'main'"), 3915 ) 3916 self.expectOutcome(result=SUCCESS, state_string='Cleaned up git repository') 3917 return self.runStep() 3918 3919 def test_failure(self): 3920 self.setupStep(CleanGitRepo()) 3921 self.setProperty('buildername', 'Commit-Queue') 3922 3923 self.expectRemoteCommands( 3924 ExpectShell(command=['git', 'clean', '-f'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3925 + ExpectShell.log('stdio', stdout=''), 3926 ExpectShell(command=['git', 'fetch', 'origin'], workdir='wkdir', timeout=1200, logEnviron=False) + 128 3927 + ExpectShell.log('stdio', stdout='fatal: unable to access https://github.com/WebKit/WebKit.git/: Could not resolve host: github.com'), 3928 ExpectShell(command=['git', 'checkout', 'origin/main', '-f'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3929 + ExpectShell.log('stdio', stdout='You are in detached HEAD state.'), 3930 ExpectShell(command=['git', 'branch', '-D', 'main'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3931 + ExpectShell.log('stdio', stdout='Deleted branch main (was 57015967fef9).'), 3932 ExpectShell(command=['git', 'checkout', 'origin/main', '-b', 'main'], workdir='wkdir', timeout=1200, logEnviron=False) + 0 3933 + ExpectShell.log('stdio', stdout="Switched to a new branch 'main'"), 3934 ) 3935 self.expectOutcome(result=FAILURE, state_string='Encountered some issues during cleanup') 3936 return self.runStep() 3937 3938 3892 3939 class TestFindModifiedChangeLogs(BuildStepMixinAdditions, unittest.TestCase): 3893 3940 def setUp(self): -
trunk/Tools/ChangeLog
r275814 r275853 1 2021-04-12 Aakash Jain <aakash_jain@apple.com> 2 3 Make Commit Queue robust by adding few git commands to clean up repository 4 https://bugs.webkit.org/show_bug.cgi?id=224444 5 6 Reviewed by Jonathan Bedard. 7 8 * CISupport/ews-build/steps.py: 9 (CleanGitRepo): Build step to run few commands to cleanup git repository. 10 (CleanGitRepo.run): 11 (CleanGitRepo.getResultSummary): Custom failure message. 12 * CISupport/ews-build/steps_unittest.py: Added unit-tests. 13 * CISupport/ews-build/factories.py: 14 (CommitQueueFactory.__init__): 15 * CISupport/ews-build/factories_unittest.py: 16 (TestCommitQueueFactory.test_commit_queue_factory): Updated unit-test. 17 1 18 2021-04-11 Commit Queue <commit-queue@webkit.org> 2 19
Note: See TracChangeset
for help on using the changeset viewer.