You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2018/02/22 21:52:52 UTC

[1/2] lucene-solr:master: LUCENE-8106: add cmdline option --no-git to avoid all git usage; replaces --no-fetch cmdline option

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 96eb58de0 -> 27f5ca75a
  refs/heads/master d2d987fd7 -> edd54e551


LUCENE-8106: add cmdline option --no-git to avoid all git usage; replaces --no-fetch cmdline option


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/edd54e55
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/edd54e55
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/edd54e55

Branch: refs/heads/master
Commit: edd54e551d5ae9cd675482bab042b0cce8fb02e2
Parents: d2d987f
Author: Steve Rowe <sa...@apache.org>
Authored: Thu Feb 22 16:52:09 2018 -0500
Committer: Steve Rowe <sa...@apache.org>
Committed: Thu Feb 22 16:52:09 2018 -0500

----------------------------------------------------------------------
 dev-tools/scripts/reproduceJenkinsFailures.py | 65 +++++++++++-----------
 1 file changed, 34 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/edd54e55/dev-tools/scripts/reproduceJenkinsFailures.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/reproduceJenkinsFailures.py b/dev-tools/scripts/reproduceJenkinsFailures.py
index fa561ec..775a22a 100644
--- a/dev-tools/scripts/reproduceJenkinsFailures.py
+++ b/dev-tools/scripts/reproduceJenkinsFailures.py
@@ -63,8 +63,8 @@ def readConfig():
                                    description=description)
   parser.add_argument('url', metavar='URL',
                       help='Points to the Jenkins log to parse')
-  parser.add_argument('--no-fetch', dest='fetch', action='store_false', default=True,
-                      help='Do not run "git fetch" prior to "git checkout"')
+  parser.add_argument('--no-git', dest='useGit', action='store_false', default=True,
+                      help='Do not run "git" at all')
   parser.add_argument('--iters', dest='testIters', type=int, default=defaultIters, metavar='N',
                       help='Number of iterations per test suite (default: %d)' % defaultIters)
   return parser.parse_args()
@@ -123,18 +123,19 @@ def fetchAndParseJenkinsLog(url):
     sys.exit(0)
   return tests
 
-def prepareWorkspace(fetch, gitRef):
+def prepareWorkspace(useGit, gitRef):
   global gitCheckoutSucceeded
-  if fetch:
+  if useGit:
     code = run('git fetch')
     if 0 != code:
       raise RuntimeError('ERROR: "git fetch" failed.  See above.')
-  checkoutCmd = 'git checkout %s' % gitRef
-  code = run(checkoutCmd)
-  if 0 != code:
-    raise RuntimeError('ERROR: "%s" failed.  See above.' % checkoutCmd)
-  gitCheckoutSucceeded = True
-  run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
+    checkoutCmd = 'git checkout %s' % gitRef
+    code = run(checkoutCmd)
+    if 0 != code:
+      raise RuntimeError('ERROR: "%s" failed.  See above.' % checkoutCmd)
+    gitCheckoutSucceeded = True
+    run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
+  
   code = run('ant clean')
   if 0 != code:
     raise RuntimeError('ERROR: "ant clean" failed.  See above.')
@@ -207,46 +208,48 @@ def getLocalGitBranch():
 def main():
   config = readConfig()
   tests = fetchAndParseJenkinsLog(config.url)
-  localGitBranch = getLocalGitBranch()
+  if config.useGit:
+    localGitBranch = getLocalGitBranch()
 
   try:
-    prepareWorkspace(config.fetch, revisionFromLog)
+    prepareWorkspace(config.useGit, revisionFromLog)
     modules = groupTestsByModule(tests)
     runTests(config.testIters, modules, tests)
     failures = printReport(config.testIters, '')
     
-    # Retest 100% failures at the tip of the branch
-    oldTests = tests
-    tests = {}
-    for fullClass in failures:
-      testcase = fullClass[(fullClass.rindex('.') + 1):]
-      if failures[fullClass] == config.testIters:
-        tests[testcase] = oldTests[testcase]
-    if len(tests) > 0:
-      print('\n[repro] Re-testing 100%% failures at the tip of %s' % branchFromLog)
-      prepareWorkspace(False, branchFromLog)
-      modules = groupTestsByModule(tests)
-      runTests(config.testIters, modules, tests)
-      failures = printReport(config.testIters, ' at the tip of %s' % branchFromLog)
-      
-      # Retest 100% tip-of-branch failures without a seed
+    if config.useGit:
+      # Retest 100% failures at the tip of the branch
       oldTests = tests
       tests = {}
       for fullClass in failures:
         testcase = fullClass[(fullClass.rindex('.') + 1):]
         if failures[fullClass] == config.testIters:
-          tests[testcase] = re.sub(reTestsSeed, '', oldTests[testcase])
+          tests[testcase] = oldTests[testcase]
       if len(tests) > 0:
-        print('\n[repro] Re-testing 100%% failures at the tip of %s without a seed' % branchFromLog)
+        print('\n[repro] Re-testing 100%% failures at the tip of %s' % branchFromLog)
         prepareWorkspace(False, branchFromLog)
         modules = groupTestsByModule(tests)
         runTests(config.testIters, modules, tests)
-        printReport(config.testIters, ' at the tip of %s without a seed' % branchFromLog)
+        failures = printReport(config.testIters, ' at the tip of %s' % branchFromLog)
+      
+        # Retest 100% tip-of-branch failures without a seed
+        oldTests = tests
+        tests = {}
+        for fullClass in failures:
+          testcase = fullClass[(fullClass.rindex('.') + 1):]
+          if failures[fullClass] == config.testIters:
+            tests[testcase] = re.sub(reTestsSeed, '', oldTests[testcase])
+        if len(tests) > 0:
+          print('\n[repro] Re-testing 100%% failures at the tip of %s without a seed' % branchFromLog)
+          prepareWorkspace(False, branchFromLog)
+          modules = groupTestsByModule(tests)
+          runTests(config.testIters, modules, tests)
+          printReport(config.testIters, ' at the tip of %s without a seed' % branchFromLog)
   except Exception as e:
     print('[repro] %s' % traceback.format_exc())
     sys.exit(1)
   finally:
-    if gitCheckoutSucceeded:
+    if config.useGit and gitCheckoutSucceeded:
       run('git checkout %s' % localGitBranch, rememberFailure=False) # Restore original git branch/sha
 
   print('[repro] Exiting with code %d' % lastFailureCode)


[2/2] lucene-solr:branch_7x: LUCENE-8106: add cmdline option --no-git to avoid all git usage; replaces --no-fetch cmdline option

Posted by sa...@apache.org.
LUCENE-8106: add cmdline option --no-git to avoid all git usage; replaces --no-fetch cmdline option


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/27f5ca75
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/27f5ca75
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/27f5ca75

Branch: refs/heads/branch_7x
Commit: 27f5ca75ad811532e5b46b32ba858b5997ed87b4
Parents: 96eb58d
Author: Steve Rowe <sa...@apache.org>
Authored: Thu Feb 22 16:52:09 2018 -0500
Committer: Steve Rowe <sa...@apache.org>
Committed: Thu Feb 22 16:52:40 2018 -0500

----------------------------------------------------------------------
 dev-tools/scripts/reproduceJenkinsFailures.py | 65 +++++++++++-----------
 1 file changed, 34 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/27f5ca75/dev-tools/scripts/reproduceJenkinsFailures.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/reproduceJenkinsFailures.py b/dev-tools/scripts/reproduceJenkinsFailures.py
index fa561ec..775a22a 100644
--- a/dev-tools/scripts/reproduceJenkinsFailures.py
+++ b/dev-tools/scripts/reproduceJenkinsFailures.py
@@ -63,8 +63,8 @@ def readConfig():
                                    description=description)
   parser.add_argument('url', metavar='URL',
                       help='Points to the Jenkins log to parse')
-  parser.add_argument('--no-fetch', dest='fetch', action='store_false', default=True,
-                      help='Do not run "git fetch" prior to "git checkout"')
+  parser.add_argument('--no-git', dest='useGit', action='store_false', default=True,
+                      help='Do not run "git" at all')
   parser.add_argument('--iters', dest='testIters', type=int, default=defaultIters, metavar='N',
                       help='Number of iterations per test suite (default: %d)' % defaultIters)
   return parser.parse_args()
@@ -123,18 +123,19 @@ def fetchAndParseJenkinsLog(url):
     sys.exit(0)
   return tests
 
-def prepareWorkspace(fetch, gitRef):
+def prepareWorkspace(useGit, gitRef):
   global gitCheckoutSucceeded
-  if fetch:
+  if useGit:
     code = run('git fetch')
     if 0 != code:
       raise RuntimeError('ERROR: "git fetch" failed.  See above.')
-  checkoutCmd = 'git checkout %s' % gitRef
-  code = run(checkoutCmd)
-  if 0 != code:
-    raise RuntimeError('ERROR: "%s" failed.  See above.' % checkoutCmd)
-  gitCheckoutSucceeded = True
-  run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
+    checkoutCmd = 'git checkout %s' % gitRef
+    code = run(checkoutCmd)
+    if 0 != code:
+      raise RuntimeError('ERROR: "%s" failed.  See above.' % checkoutCmd)
+    gitCheckoutSucceeded = True
+    run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
+  
   code = run('ant clean')
   if 0 != code:
     raise RuntimeError('ERROR: "ant clean" failed.  See above.')
@@ -207,46 +208,48 @@ def getLocalGitBranch():
 def main():
   config = readConfig()
   tests = fetchAndParseJenkinsLog(config.url)
-  localGitBranch = getLocalGitBranch()
+  if config.useGit:
+    localGitBranch = getLocalGitBranch()
 
   try:
-    prepareWorkspace(config.fetch, revisionFromLog)
+    prepareWorkspace(config.useGit, revisionFromLog)
     modules = groupTestsByModule(tests)
     runTests(config.testIters, modules, tests)
     failures = printReport(config.testIters, '')
     
-    # Retest 100% failures at the tip of the branch
-    oldTests = tests
-    tests = {}
-    for fullClass in failures:
-      testcase = fullClass[(fullClass.rindex('.') + 1):]
-      if failures[fullClass] == config.testIters:
-        tests[testcase] = oldTests[testcase]
-    if len(tests) > 0:
-      print('\n[repro] Re-testing 100%% failures at the tip of %s' % branchFromLog)
-      prepareWorkspace(False, branchFromLog)
-      modules = groupTestsByModule(tests)
-      runTests(config.testIters, modules, tests)
-      failures = printReport(config.testIters, ' at the tip of %s' % branchFromLog)
-      
-      # Retest 100% tip-of-branch failures without a seed
+    if config.useGit:
+      # Retest 100% failures at the tip of the branch
       oldTests = tests
       tests = {}
       for fullClass in failures:
         testcase = fullClass[(fullClass.rindex('.') + 1):]
         if failures[fullClass] == config.testIters:
-          tests[testcase] = re.sub(reTestsSeed, '', oldTests[testcase])
+          tests[testcase] = oldTests[testcase]
       if len(tests) > 0:
-        print('\n[repro] Re-testing 100%% failures at the tip of %s without a seed' % branchFromLog)
+        print('\n[repro] Re-testing 100%% failures at the tip of %s' % branchFromLog)
         prepareWorkspace(False, branchFromLog)
         modules = groupTestsByModule(tests)
         runTests(config.testIters, modules, tests)
-        printReport(config.testIters, ' at the tip of %s without a seed' % branchFromLog)
+        failures = printReport(config.testIters, ' at the tip of %s' % branchFromLog)
+      
+        # Retest 100% tip-of-branch failures without a seed
+        oldTests = tests
+        tests = {}
+        for fullClass in failures:
+          testcase = fullClass[(fullClass.rindex('.') + 1):]
+          if failures[fullClass] == config.testIters:
+            tests[testcase] = re.sub(reTestsSeed, '', oldTests[testcase])
+        if len(tests) > 0:
+          print('\n[repro] Re-testing 100%% failures at the tip of %s without a seed' % branchFromLog)
+          prepareWorkspace(False, branchFromLog)
+          modules = groupTestsByModule(tests)
+          runTests(config.testIters, modules, tests)
+          printReport(config.testIters, ' at the tip of %s without a seed' % branchFromLog)
   except Exception as e:
     print('[repro] %s' % traceback.format_exc())
     sys.exit(1)
   finally:
-    if gitCheckoutSucceeded:
+    if config.useGit and gitCheckoutSucceeded:
       run('git checkout %s' % localGitBranch, rememberFailure=False) # Restore original git branch/sha
 
   print('[repro] Exiting with code %d' % lastFailureCode)