Apache Solr open-source search software
SOLR-15852: Smoketester fixes for maven artifact comparison (#763)
Jan Høydahlcaf1071f9df9
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.pyindex 008dd1aced0..75a1d92bf61 100755--- a/dev-tools/scripts/smokeTestRelease.py+++ b/dev-tools/scripts/smokeTestRelease.py@@ -424,7 +424,7 @@ def versionToTuple(version, name):reUnixPath = re.compile(r'\b[a-zA-Z_]+=(?:"(?:\\"|[^"])*"' + '|(?:\\\\.|[^"\'\\s])*' + r"|'(?:\\'|[^'])*')" \+ r'|(/(?:\\.|[^"\'\s])*)' \- + r'|("/(?:\\.|[^"])*")' \+ + r'|("/(?:\\.|[^"])*")' \+ r"|('/(?:\\.|[^'])*')")@@ -626,22 +626,23 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):print(" run tests w/ Java 11 and testArgs='%s'..." % testArgs)java.run_java11('./gradlew --no-daemon test %s' % testArgs, '%s/test.log' % unpackPath)- print(" compile jars w/ Java 11")- java.run_java11('./gradlew --no-daemon jar -Dversion.release=%s' % version, '%s/compile.log' % unpackPath)- print(" run interation tests w/ Java 11")+ print(" run integration tests w/ Java 11")java.run_java11('./gradlew --no-daemon integrationTest -Dversion.release=%s' % version, '%s/itest.log' % unpackPath)- testSolrExample(unpackPath, java.java11_home, True)+ print(" build binary release w/ Java 11")+ java.run_java11('./gradlew --no-daemon dev -Dversion.release=%s' % version, '%s/assemble.log' % unpackPath)+ testSolrExample("%s/solr/packaging/build/dev" % unpackPath, java.java11_home, True)if java.run_java17:print(" run tests w/ Java 17 and testArgs='%s'..." % testArgs)- java.run_java17('./gradlew --no-daemon test %s' % testArgs, '%s/test.log' % unpackPath)- print(" compile jars w/ Java 17")- java.run_java17('./gradlew --no-daemon jar -Dversion.release=%s' % version, '%s/compile.log' % unpackPath)- print(" run interation tests w/ Java 17")- java.run_java17('./gradlew --no-daemon integrationTest -Dversion.release=%s' % version, '%s/itest.log' % unpackPath)- testSolrExample(unpackPath, java.java17_home, True)+ java.run_java17('./gradlew --no-daemon clean test %s' % testArgs, '%s/test-java17.log' % unpackPath)+ print(" run integration tests w/ Java 17")+ java.run_java17('./gradlew --no-daemon integrationTest -Dversion.release=%s' % version, '%s/itest-java17.log' % unpackPath)+ print(" build binary release w/ Java 17")+ java.run_java17('./gradlew --no-daemon dev -Dversion.release=%s' % version, '%s/assemble-java17.log' % unpackPath)+ testSolrExample("%s/solr/packaging/build/dev" % unpackPath, java.java17_home, True)else:+ # Binary tarballcheckAllJARs(os.getcwd(), gitRevision, version)print(' copying unpacked distribution for Java 11 ...')@@ -706,11 +707,7 @@ def is_port_in_use(port):def testSolrExample(unpackPath, javaPath, isSrc):# test solr using some examples it comes withlogFile = '%s/solr-example.log' % unpackPath- if isSrc:- os.chdir(unpackPath+'/solr')- subprocess.call(['chmod','+x',unpackPath+'/solr/bin/solr', unpackPath+'/solr/bin/solr.cmd', unpackPath+'/solr/bin/solr.in.cmd'])- else:- os.chdir(unpackPath)+ os.chdir(unpackPath)print(' start Solr instance (log=%s)...' % logFile)env = {}@@ -725,7 +722,7 @@ def testSolrExample(unpackPath, javaPath, isSrc):else:subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd stop -p 8983', shell=True)except:- print(' Stop failed due to: '+sys.exc_info()[0])+ print(' Stop failed due to: '+sys.exc_info()[0])print(' Running techproducts example on port 8983 from %s' % unpackPath)try:@@ -752,20 +749,14 @@ def testSolrExample(unpackPath, javaPath, isSrc):finally:# Stop server:print(' stop server using: bin/solr stop -p 8983')- if isSrc:- os.chdir(unpackPath+'/solr')- else:- os.chdir(unpackPath)+ os.chdir(unpackPath)if not cygwin:subprocess.call(['bin/solr','stop','-p','8983'])else:subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd stop -p 8983', shell=True)- if isSrc:- os.chdir(unpackPath+'/solr')- else:- os.chdir(unpackPath)+ os.chdir(unpackPath)def removeTrailingZeros(version):@@ -775,7 +766,7 @@ def removeTrailingZeros(version):def checkMaven(baseURL, tmpDir, gitRevision, version, isSigned, keysFile):print(' download artifacts')artifacts = []- artifactsURL = '%s/solr/maven/org/apache/solr/' % baseURL+ artifactsURL = '%s/maven/org/apache/solr/' % baseURLtargetDir = '%s/maven/org/apache/solr' % tmpDirif not os.path.exists(targetDir):os.makedirs(targetDir)@@ -836,12 +827,16 @@ def checkIdenticalMavenArtifacts(distFiles, artifacts, version):for artifact in artifacts:if reJarWar.search(artifact):artifactFilename = os.path.basename(artifact)+ if artifactFilename in ['solr-test-framework-%s.jar' % version]:+ if artifactFilename in distFilenames:+ raise RuntimeError(' solr-test-framework should not be present in solr binary distribution' % artifact)+ continueif artifactFilename not in distFilenames:- raise RuntimeError('Maven artifact %s is not present in solr binary distribution' % artifact)+ raise RuntimeError(' Maven artifact %s is not present in solr binary distribution' % artifact)else:identical = filecmp.cmp(artifact, distFilenames[artifactFilename], shallow=False)if not identical:- raise RuntimeError('Maven artifact %s is not identical to %s in solr binary distribution'+ raise RuntimeError(' Maven artifact %s is not identical to %s in solr binary distribution'% (artifact, distFilenames[artifactFilename]))@@ -1090,11 +1085,10 @@ def main():def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys, testArgs, downloadOnly=False):startTime = datetime.datetime.now()- # Tests annotated @Nightly are more resource-intensive but often cover- # important code paths. They're disabled by default to preserve a good- # developer experience, but we enable them for smoke tests where we want good- # coverage. Still we disable @BadApple tests- testArgs = '-Dtests.nightly=true -Dtests.badapples=false %s' % testArgs+ # Avoid @Nightly and @Badapple tests as they are slow and buggy+ # Instead verify that the recent Jenkins tests pass+ print('NOTE: Not running @Nightly or @BadApple tests. Please verify that recent Jenkins runs have passed.')+ testArgs = '-Dtests.nightly=false -Dtests.badapples=false %s' % testArgsif FORCE_CLEAN:if os.path.exists(tmpDir):