()
| 249 | return origGitBranch |
| 250 | |
| 251 | def main(): |
| 252 | config = readConfig() |
| 253 | tests = fetchAndParseJenkinsLog(config.url, numRetries = 2) |
| 254 | if config.useGit: |
| 255 | localGitBranch = getLocalGitBranch() |
| 256 | |
| 257 | try: |
| 258 | # have to play nice with ant clean, so printAndMoveReports will move all the junit XML files here... |
| 259 | print('[repro] JUnit rest result XML files will be moved to: ./repro-reports') |
| 260 | if os.path.isdir('repro-reports'): |
| 261 | print('[repro] Deleting old ./repro-reports'); |
| 262 | shutil.rmtree('repro-reports') |
| 263 | prepareWorkspace(config.useGit, revisionFromLog) |
| 264 | modules = groupTestsByModule(tests) |
| 265 | runTests(config.testIters, modules, tests) |
| 266 | failures = printAndMoveReports(config.testIters, 'orig', |
| 267 | ' w/original seeds' + (' at %s' % revisionFromLog if config.useGit else '')) |
| 268 | |
| 269 | |
| 270 | if config.useGit: |
| 271 | # Retest 100% failures at the tip of the branch |
| 272 | oldTests = tests |
| 273 | tests = {} |
| 274 | for fullClass in failures: |
| 275 | testcase = fullClass[(fullClass.rindex('.') + 1):] |
| 276 | if failures[fullClass] == config.testIters: |
| 277 | tests[testcase] = oldTests[testcase] |
| 278 | if len(tests) > 0: |
| 279 | print('\n[repro] Re-testing 100%% failures at the tip of %s' % branchFromLog) |
| 280 | prepareWorkspace(True, branchFromLog) |
| 281 | modules = groupTestsByModule(tests) |
| 282 | runTests(config.testIters, modules, tests) |
| 283 | failures = printAndMoveReports(config.testIters, 'branch-tip', |
| 284 | ' original seeds at the tip of %s' % branchFromLog) |
| 285 | |
| 286 | # Retest 100% tip-of-branch failures without a seed |
| 287 | oldTests = tests |
| 288 | tests = {} |
| 289 | for fullClass in failures: |
| 290 | testcase = fullClass[(fullClass.rindex('.') + 1):] |
| 291 | if failures[fullClass] == config.testIters: |
| 292 | tests[testcase] = re.sub(reTestsSeed, '', oldTests[testcase]) |
| 293 | if len(tests) > 0: |
| 294 | print('\n[repro] Re-testing 100%% failures at the tip of %s without a seed' % branchFromLog) |
| 295 | prepareWorkspace(False, branchFromLog) |
| 296 | modules = groupTestsByModule(tests) |
| 297 | runTests(config.testIters, modules, tests) |
| 298 | printAndMoveReports(config.testIters, 'branch-tip-no-seed', |
| 299 | ' at the tip of %s without a seed' % branchFromLog) |
| 300 | except Exception as e: |
| 301 | print('[repro] %s' % traceback.format_exc()) |
| 302 | sys.exit(1) |
| 303 | finally: |
| 304 | if config.useGit and gitCheckoutSucceeded: |
| 305 | run('git checkout %s' % localGitBranch, rememberFailure=False) # Restore original git branch/sha |
| 306 | |
| 307 | print('[repro] Exiting with code %d' % lastFailureCode) |
| 308 | sys.exit(lastFailureCode) |
no test coverage detected
searching dependent graphs…