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 2016/02/15 01:30:35 UTC

lucene-solr git commit: LUCENE-7024, LUCENE-6938: fix smoke tester to pull pom.xml.template files from the Solr source distribution instead of from svn (cherry-picked branch_5_5 commit f6a1bbf)

Repository: lucene-solr
Updated Branches:
  refs/heads/master 19c56f208 -> ef965661a


LUCENE-7024, LUCENE-6938: fix smoke tester to pull pom.xml.template files from the Solr source distribution instead of from svn
(cherry-picked branch_5_5 commit f6a1bbf)


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

Branch: refs/heads/master
Commit: ef965661abf108f10b3da78aaec27576a7ef00c7
Parents: 19c56f2
Author: Steve Rowe <sa...@apache.org>
Authored: Fri Feb 12 13:39:35 2016 -0800
Committer: Steve Rowe <sa...@apache.org>
Committed: Sun Feb 14 19:27:26 2016 -0500

----------------------------------------------------------------------
 dev-tools/scripts/smokeTestRelease.py | 55 ++++++++++--------------------
 1 file changed, 18 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef965661/dev-tools/scripts/smokeTestRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 2ddc71d..d76e8fa 100644
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -90,7 +90,7 @@ def getHREFs(urlString):
       h = http.client.HTTPSConnection(url.netloc)
     else:
       raise RuntimeError("Unknown protocol: %s" % url.scheme)
-    h.request('GET', url.path)
+    h.request('HEAD', url.path)
     r = h.getresponse()
     newLoc = r.getheader('location')
     if newLoc is not None:
@@ -588,6 +588,7 @@ def unpackAndVerify(java, project, tmpDir, artifact, gitRevision, version, testA
 
   unpackPath = '%s/%s' % (destDir, expected)
   verifyUnpacked(java, project, artifact, unpackPath, gitRevision, version, testArgs, tmpDir, baseURL)
+  return unpackPath
 
 LUCENE_NOTICE = None
 LUCENE_LICENSE = None
@@ -887,21 +888,10 @@ def testDemo(run_java, isSrc, version, jdk):
 
 def removeTrailingZeros(version):
   return re.sub(r'(\.0)*$', '', version)
-  
-def checkMaven(baseURL, tmpDir, svnRevision, version, isSigned):
-  # Locate the release branch in subversion
-  m = re.match('(\d+)\.(\d+)', version) # Get Major.minor version components
-  releaseBranchText = 'lucene_solr_%s_%s/' % (m.group(1), m.group(2))
-  branchesURL = 'http://svn.apache.org/repos/asf/lucene/dev/branches/'
-  releaseBranchSvnURL = None
-  branches = getDirEntries(branchesURL)
-  for text, subURL in branches:
-    if text == releaseBranchText:
-      releaseBranchSvnURL = subURL
 
+def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned):
   POMtemplates = defaultdict()
-  getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL)
-  print()
+  getPOMtemplates(solrSrcUnpackPath, POMtemplates, tmpDir)
   print('    download artifacts')
   artifacts = {'lucene': [], 'solr': []}
   for project in ('lucene', 'solr'):
@@ -922,10 +912,11 @@ def checkMaven(baseURL, tmpDir, svnRevision, version, isSigned):
   distFiles = getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL)
   checkIdenticalMavenArtifacts(distFiles, artifacts, version)
 
-  checkAllJARs('%s/maven/org/apache/lucene' % tmpDir, 'lucene', svnRevision, version, tmpDir, baseURL)
-  checkAllJARs('%s/maven/org/apache/solr' % tmpDir, 'solr', svnRevision, version, tmpDir, baseURL)
+  checkAllJARs('%s/maven/org/apache/lucene' % tmpDir, 'lucene', gitRevision, version, tmpDir, baseURL)
+  checkAllJARs('%s/maven/org/apache/solr' % tmpDir, 'solr', gitRevision, version, tmpDir, baseURL)
 
 def getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL):
+  # TODO: refactor distribution unpacking so that it only happens once per distribution per smoker run
   distFiles = defaultdict()
   for project in ('lucene', 'solr'):
     distFiles[project] = getBinaryDistFiles(project, tmpDir, version, baseURL)
@@ -1140,35 +1131,24 @@ def verifyArtifactPerPOMtemplate(POMtemplates, artifacts, tmpDir, version):
         if artifact not in artifacts['lucene'] and artifact not in artifacts['solr']:
           raise RuntimeError('Missing artifact %s' % artifact)
 
-def getPOMtemplates(POMtemplates, tmpDir, releaseBranchSvnURL):
-  print('    get POM templates')
+def getPOMtemplates(solrSrcUnpackPath, POMtemplates, tmpDir):
+  print('    find pom.xml.template files in the unpacked Solr source distribution')
   allPOMtemplates = []
-  sourceLocation = releaseBranchSvnURL
-  if sourceLocation is None:
-    # Use the POM templates under dev-tools/maven/ in the local working copy
-    # sys.path[0] is the directory containing this script: dev-tools/scripts/
-    sourceLocation = os.path.abspath('%s/../maven' % sys.path[0])
-    rePOMtemplate = re.compile(r'^pom.xml.template$')
-    for root, dirs, files in os.walk(sourceLocation):
-      allPOMtemplates.extend([os.path.join(root, f) for f in files if rePOMtemplate.search(f)])
-  else:
-    sourceLocation += 'dev-tools/maven/'
-    targetDir = '%s/dev-tools/maven' % tmpDir
-    if not os.path.exists(targetDir):
-      os.makedirs(targetDir)
-    crawl(allPOMtemplates, sourceLocation, targetDir, set(['Apache Subversion', 'maven.testlogging.properties']))
+  rePOMtemplate = re.compile(r'^pom\.xml\.template$')
+  for root, dirs, files in os.walk(solrSrcUnpackPath):
+    allPOMtemplates.extend([os.path.join(root, f) for f in files if rePOMtemplate.search(f)])
 
   reLucenePOMtemplate = re.compile(r'.*/maven/lucene.*/pom\.xml\.template$')
   POMtemplates['lucene'] = [p for p in allPOMtemplates if reLucenePOMtemplate.search(p)]
   if POMtemplates['lucene'] is None:
-    raise RuntimeError('No Lucene POMs found at %s' % sourceLocation)
+    raise RuntimeError('No Lucene POMs found at %s' % solrSrcUnpackPath)
   reSolrPOMtemplate = re.compile(r'.*/maven/solr.*/pom\.xml\.template$')
   POMtemplates['solr'] = [p for p in allPOMtemplates if reSolrPOMtemplate.search(p)]
   if POMtemplates['solr'] is None:
-    raise RuntimeError('No Solr POMs found at %s' % sourceLocation)
+    raise RuntimeError('No Solr POMs found at %s' % solrSrcUnpackPath)
   POMtemplates['grandfather'] = [p for p in allPOMtemplates if '/maven/pom.xml.template' in p]
   if len(POMtemplates['grandfather']) == 0:
-    raise RuntimeError('No Lucene/Solr grandfather POM found at %s' % sourceLocation)
+    raise RuntimeError('No Lucene/Solr grandfather POM found at %s' % solrSrcUnpackPath)
 
 def crawl(downloadedFiles, urlString, targetDir, exclusions=set()):
   for text, subURL in getDirEntries(urlString):
@@ -1417,11 +1397,12 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, testArgs):
   checkSigs('solr', solrPath, version, tmpDir, isSigned)
   for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version):
     unpackAndVerify(java, 'solr', tmpDir, artifact, gitRevision, version, testArgs, baseURL)
-  unpackAndVerify(java, 'solr', tmpDir, 'solr-%s-src.tgz' % version, gitRevision, version, testArgs, baseURL)
+  solrSrcUnpackPath = unpackAndVerify(java, 'solr', tmpDir, 'solr-%s-src.tgz' % version,
+                                       gitRevision, version, testArgs, baseURL)
 
   print()
   print('Test Maven artifacts for Lucene and Solr...')
-  checkMaven(baseURL, tmpDir, gitRevision, version, isSigned)
+  checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned)
 
   print('\nSUCCESS! [%s]\n' % (datetime.datetime.now() - startTime))