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

Function printAndMoveReports

dev-tools/scripts/reproduceJenkinsFailures.py:218–242  ·  view source on GitHub ↗
(testIters, newSubDir, location)

Source from the content-addressed store, hash-verified

216 os.chdir(cwd)
217
218def printAndMoveReports(testIters, newSubDir, location):
219 failures = {}
220 for start in ('lucene/build', 'solr/build'):
221 for (dir, _, files) in os.walk(start):
222 for file in files:
223 testOutputFileMatch = reTestOutputFile.search(file)
224 if testOutputFileMatch is not None:
225 testcase = testOutputFileMatch.group(1)
226 if testcase not in failures:
227 failures[testcase] = 0
228 filePath = os.path.join(dir, file)
229 with open(filePath, encoding='UTF-8') as testOutputFile:
230 for line in testOutputFile:
231 errorFailureMatch = reErrorFailure.search(line)
232 if errorFailureMatch is not None:
233 failures[testcase] += 1
234 break
235 # have to play nice with 'ant clean'...
236 newDirPath = os.path.join('repro-reports', newSubDir, dir)
237 os.makedirs(newDirPath, exist_ok=True)
238 os.rename(filePath, os.path.join(newDirPath, file))
239 print("[repro] Failures%s:" % location)
240 for testcase in sorted(failures, key=lambda t: (failures[t],t)): # sort by failure count, then by testcase
241 print("[repro] %d/%d failed: %s" % (failures[testcase], testIters, testcase))
242 return failures
243
244def getLocalGitBranch():
245 origGitBranch = runOutput('git rev-parse --abbrev-ref HEAD')

Callers 1

mainFunction · 0.85

Calls 4

renameMethod · 0.65
walkMethod · 0.45
searchMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…