MCPcopy Create free account
hub / github.com/apache/solr / prepareWorkspace

Function prepareWorkspace

dev-tools/scripts/reproduceJenkinsFailures.py:156–179  ·  view source on GitHub ↗
(useGit, gitRef)

Source from the content-addressed store, hash-verified

154 return tests
155
156def prepareWorkspace(useGit, gitRef):
157 global gitCheckoutSucceeded
158 if useGit:
159 code = run('git fetch')
160 if 0 != code:
161 raise RuntimeError('ERROR: "git fetch" failed. See above.')
162 checkoutCmd = 'git checkout %s' % gitRef
163 code = run(checkoutCmd)
164 if 0 != code:
165 addWantedBranchCmd = "git remote set-branches --add origin %s" % gitRef
166 checkoutBranchCmd = 'git checkout -t -b %s origin/%s' % (gitRef, gitRef) # Checkout remote branch as new local branch
167 print('"%s" failed. Trying "%s" and "%s".' % (checkoutCmd, addWantedBranchCmd, checkoutBranchCmd))
168 code = run(addWantedBranchCmd)
169 if 0 != code:
170 raise RuntimeError('ERROR: "%s" failed. See above.' % addWantedBranchCmd)
171 code = run(checkoutBranchCmd)
172 if 0 != code:
173 raise RuntimeError('ERROR: "%s" failed. See above.' % checkoutBranchCmd)
174 gitCheckoutSucceeded = True
175 run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
176
177 code = run('ant clean')
178 if 0 != code:
179 raise RuntimeError('ERROR: "ant clean" failed. See above.')
180
181def groupTestsByModule(tests):
182 modules = {}

Callers 1

mainFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…