LUCENE-5909: Smoke tester now has better command line parsing and optionally also runs on Java 8

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1621473 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-08-30 15:48:16 +00:00
parent 21e2609d40
commit 9cba8eb45f
4 changed files with 161 additions and 117 deletions

101
build.xml
View File

@ -37,9 +37,8 @@
<property name="maven-version" value="2.2.1"/> <property name="maven-version" value="2.2.1"/>
<property name="maven.dependencies.filters.file" location="lucene/build/maven.dependencies.filters.properties"/> <property name="maven.dependencies.filters.file" location="lucene/build/maven.dependencies.filters.properties"/>
<property name="fakeRelease" location="lucene/build/fakeRelease"/> <property name="smokeTestRelease.dir" location="lucene/build/smokeTestRelease/dist"/>
<property name="fakeReleaseTmp" location="lucene/build/fakeReleaseTmp"/> <property name="smokeTestRelease.tmp" location="lucene/build/smokeTestRelease/tmp"/>
<property name="fakeReleaseVersion" value="${version.base}"/>
<property name="smokeTestRelease.testArgs" value=""/> <property name="smokeTestRelease.testArgs" value=""/>
<target name="-projecthelp"> <target name="-projecthelp">
@ -372,52 +371,60 @@ File | Project Structure | Platform Settings | SDKs):
<fileset dir="solr" includes="build.xml" /> <fileset dir="solr" includes="build.xml" />
</subant> </subant>
</target> </target>
<target name="-nightly-smoke-java8params" if="smokeTestRelease.java8">
<!-- convert path to UNIX style, so windows backslashes don't hurt escaping: -->
<pathconvert targetos="unix" property="-smokeTestRelease.java8params">
<regexpmapper from="^(.*)$" to="--test-java8 '\1'"/>
<path location="smokeTestRelease.java8"/>
</pathconvert>
</target>
<target name="-load-env"> <target name="nightly-smoke" description="Builds an unsigned release and smoke tests it, pass '-DsmokeTestRelease.java8=/path/to/jdk1.8.0' to enable Java 8)"
<!-- load the properties only here, so not on every invocation /usr/bin/env is called: --> depends="clean,-nightly-smoke-java8params">
<property environment="env"/> <fail message="To run nightly smoke, the JDK must be exactly Java 1.7, was: ${java.specification.version}">
</target> <condition>
<not><equals arg1="${java.specification.version}" arg2="1.7"/></not>
<target name="-env-JAVA7_HOME" depends="-load-env" if="env.JAVA7_HOME"> </condition>
<property name="JAVA7_HOME" value="${env.JAVA7_HOME}"/> </fail>
</target> <property name="-smokeTestRelease.java8params" value=""/><!-- (if not yet defined) -->
<exec executable="${python32.exe}" failonerror="true" taskname="python32">
<target name="nightly-smoke" description="Builds an unsigned release and smoke tests it" depends="clean,-env-JAVA7_HOME">
<fail unless="JAVA7_HOME">JAVA7_HOME property or environment variable is not defined.</fail>
<exec executable="${python32.exe}" failonerror="true">
<arg value="-V"/> <arg value="-V"/>
</exec> </exec>
<subant target="prepare-release-no-sign" inheritall="false" failonerror="true"> <subant target="prepare-release-no-sign" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" /> <fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" /> <fileset dir="solr" includes="build.xml" />
<property name="version" value="${fakeReleaseVersion}" /> <!-- pass ${version.base} here to emulate a real release, without appendix like "-SNAPSHOT": -->
</subant> <property name="version" value="${version.base}" />
<mkdir dir="${fakeRelease}"/> </subant>
<copy todir="${fakeRelease}/lucene"> <mkdir dir="${smokeTestRelease.dir}"/>
<fileset dir="lucene/dist"/> <copy todir="${smokeTestRelease.dir}/lucene">
</copy> <fileset dir="lucene/dist"/>
<copy todir="${fakeRelease}/solr"> </copy>
<fileset dir="solr/package"/> <copy todir="${smokeTestRelease.dir}/solr">
</copy> <fileset dir="solr/package"/>
<makeurl file="${fakeRelease}" validate="false" property="fakeRelease.uri"/> </copy>
<exec executable="${python32.exe}" failonerror="true"> <local name="url"/>
<arg value="-u"/> <makeurl file="${smokeTestRelease.dir}" validate="false" property="url"/>
<!-- Tell Python not to write any bytecode cache into the filesystem: --> <exec executable="${python32.exe}" failonerror="true" taskname="smoker">
<arg value="-B"/> <arg value="-u"/>
<arg file="dev-tools/scripts/smokeTestRelease.py"/> <!-- Tell Python not to write any bytecode cache into the filesystem: -->
<arg value="--revision"/> <arg value="-B"/>
<arg value="skip"/> <arg file="dev-tools/scripts/smokeTestRelease.py"/>
<arg value="--version"/> <arg line="${-smokeTestRelease.java8params}"/>
<arg value="${fakeReleaseVersion}"/> <arg value="--revision"/>
<arg value="--tmp-dir"/> <arg value="skip"/>
<arg file="${fakeReleaseTmp}"/> <!-- pass ${version.base} here to emulate a real release, without appendix like "-SNAPSHOT": -->
<arg value="--not-signed"/> <arg value="--version"/>
<arg value="${fakeRelease.uri}"/> <arg value="${version.base}"/>
<arg value="${smokeTestRelease.testArgs}"/> <arg value="--tmp-dir"/>
<env key="JAVA7_HOME" file="${JAVA7_HOME}"/> <arg file="${smokeTestRelease.tmp}"/>
</exec> <arg value="--not-signed"/>
<delete dir="${fakeRelease}"/> <arg value="${url}"/>
<delete dir="${fakeReleaseTmp}"/> <arg value="${smokeTestRelease.testArgs}"/>
</exec>
<delete dir="${smokeTestRelease.dir}"/>
<delete dir="${smokeTestRelease.tmp}"/>
</target> </target>
<target name="check-svn-working-copy" description="Checks the status of the SVN working copy"> <target name="check-svn-working-copy" description="Checks the status of the SVN working copy">

View File

@ -82,7 +82,7 @@ def getSVNRev():
return rev return rev
def prepare(root, version, gpgKeyID, gpgPassword, doTest): def prepare(root, version, gpgKeyID, gpgPassword):
print() print()
print('Prepare release...') print('Prepare release...')
if os.path.exists(LOG): if os.path.exists(LOG):
@ -96,10 +96,8 @@ def prepare(root, version, gpgKeyID, gpgPassword, doTest):
print(' svn rev: %s' % rev) print(' svn rev: %s' % rev)
log('\nSVN rev: %s\n' % rev) log('\nSVN rev: %s\n' % rev)
if doTest: print(' ant clean test')
# Don't run tests if we are gonna smoke test after the release... run('ant clean test')
print(' ant clean test')
run('ant clean test')
print(' clean checkout') print(' clean checkout')
scrubCheckout() scrubCheckout()
@ -258,8 +256,6 @@ def parse_config():
if not os.path.isdir(config.root): if not os.path.isdir(config.root):
# TODO: add additional svn check to ensure dir is a real lucene-solr checkout # TODO: add additional svn check to ensure dir is a real lucene-solr checkout
parser.error('Root path is not a valid lucene-solr checkout') parser.error('Root path is not a valid lucene-solr checkout')
if config.smoke_test is not None and os.path.exists(config.smoke_test):
parser.error('Smoke test path already exists')
config.version = read_version(config.root) config.version = read_version(config.root)
print('Building version: %s' % config.version) print('Building version: %s' % config.version)
@ -278,7 +274,7 @@ def main():
c = parse_config() c = parse_config()
if c.prepare: if c.prepare:
rev = prepare(c.root, c.version, c.key_id, c.key_password, key.smoke_test is None) rev = prepare(c.root, c.version, c.key_id, c.key_password)
else: else:
os.chdir(root) os.chdir(root)
rev = open('rev.txt', encoding='UTF-8').read() rev = open('rev.txt', encoding='UTF-8').read()
@ -292,11 +288,8 @@ def main():
if url is not None: if url is not None:
print(' URL: %s' % url) print(' URL: %s' % url)
print('Next set the PYTHON_EXEC env var and you can run the smoker tester:')
if c.smoke_test is not None: print(' $PYTHON_EXEC %s %s' % (sys.argv[0], url))
import smokeTestRelease
smokeTestRelease.DEBUG = False
smokeTestRelease.smokeTest(url, rev, c.version, c.smoke_test, c.sign is not None, '')
if __name__ == '__main__': if __name__ == '__main__':
try: try:

View File

@ -42,6 +42,7 @@ import checkJavadocLinks
import io import io
import codecs import codecs
import textwrap import textwrap
from collections import namedtuple
# This tool expects to find /lucene and /solr off the base URL. You # This tool expects to find /lucene and /solr off the base URL. You
# must have a working gpg, tar, unzip in your path. This has been # must have a working gpg, tar, unzip in your path. This has been
@ -60,30 +61,6 @@ def unshortenURL(url):
return response.getheader('Location') return response.getheader('Location')
return url return url
def javaExe(version):
if version == '1.7':
path = JAVA7_HOME
else:
raise RuntimeError("unknown Java version '%s'" % version)
if cygwin:
path = os.popen('cygpath -u "%s"' % path).read().strip()
return 'export JAVA_HOME="%s" PATH="%s/bin:$PATH" JAVACMD="%s/bin/java"' % (path, path, path)
def verifyJavaVersion(version):
s = os.popen('%s; java -version 2>&1' % javaExe(version)).read()
if s.find(' version "%s.' % version) == -1:
raise RuntimeError('got wrong version for java %s:\n%s' % (version, s))
# http://s.apache.org/lusolr32rc2
env = os.environ
try:
JAVA7_HOME = env['JAVA7_HOME']
except KeyError:
raise RuntimeError('please set JAVA7_HOME in the env before running smokeTestRelease')
print('JAVA7_HOME is %s' % JAVA7_HOME)
verifyJavaVersion('1.7')
# TODO # TODO
# + verify KEYS contains key that signed the release # + verify KEYS contains key that signed the release
# + make sure changes HTML looks ok # + make sure changes HTML looks ok
@ -616,7 +593,7 @@ def getDirEntries(urlString):
if text == 'Parent Directory' or text == '..': if text == 'Parent Directory' or text == '..':
return links[(i+1):] return links[(i+1):]
def unpackAndVerify(project, tmpDir, artifact, svnRevision, version, testArgs, baseURL): def unpackAndVerify(java, project, tmpDir, artifact, svnRevision, version, testArgs, baseURL):
destDir = '%s/unpack' % tmpDir destDir = '%s/unpack' % tmpDir
if os.path.exists(destDir): if os.path.exists(destDir):
shutil.rmtree(destDir) shutil.rmtree(destDir)
@ -636,14 +613,14 @@ def unpackAndVerify(project, tmpDir, artifact, svnRevision, version, testArgs, b
raise RuntimeError('unpack produced entries %s; expected only %s' % (l, expected)) raise RuntimeError('unpack produced entries %s; expected only %s' % (l, expected))
unpackPath = '%s/%s' % (destDir, expected) unpackPath = '%s/%s' % (destDir, expected)
verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs, tmpDir, baseURL) verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, testArgs, tmpDir, baseURL)
LUCENE_NOTICE = None LUCENE_NOTICE = None
LUCENE_LICENSE = None LUCENE_LICENSE = None
SOLR_NOTICE = None SOLR_NOTICE = None
SOLR_LICENSE = None SOLR_LICENSE = None
def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs, tmpDir, baseURL): def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, testArgs, tmpDir, baseURL):
global LUCENE_NOTICE global LUCENE_NOTICE
global LUCENE_LICENSE global LUCENE_LICENSE
global SOLR_NOTICE global SOLR_NOTICE
@ -727,34 +704,56 @@ def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs
raise RuntimeError('source release has WARs...') raise RuntimeError('source release has WARs...')
print(' run "ant validate"') print(' run "ant validate"')
run('%s; ant validate' % javaExe('1.7'), '%s/validate.log' % unpackPath) java.run_java7('ant validate', '%s/validate.log' % unpackPath)
if project == 'lucene': if project == 'lucene':
print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs) print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs)
run('%s; ant clean test %s' % (javaExe('1.7'), testArgs), '%s/test.log' % unpackPath) java.run_java7('ant clean test %s' % testArgs, '%s/test.log' % unpackPath)
run('%s; ant jar' % javaExe('1.7'), '%s/compile.log' % unpackPath) java.run_java7('ant jar', '%s/compile.log' % unpackPath)
testDemo(isSrc, version, '1.7') testDemo(java.run_java7, isSrc, version, '1.7')
print(' generate javadocs w/ Java 7...') print(' generate javadocs w/ Java 7...')
run('%s; ant javadocs' % javaExe('1.7'), '%s/javadocs.log' % unpackPath) java.run_java7('ant javadocs', '%s/javadocs.log' % unpackPath)
checkJavadocpathFull('%s/build/docs' % unpackPath) checkJavadocpathFull('%s/build/docs' % unpackPath)
if java.run_java8:
print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs)
java.run_java8('ant clean test %s' % testArgs, '%s/test.log' % unpackPath)
java.run_java8('ant jar', '%s/compile.log' % unpackPath)
testDemo(java.run_java8, isSrc, version, '1.8')
print(' generate javadocs w/ Java 8...')
java.run_java8('ant javadocs', '%s/javadocs.log' % unpackPath)
checkJavadocpathFull('%s/build/docs' % unpackPath)
else: else:
os.chdir('solr') os.chdir('solr')
print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs) print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs)
run('%s; ant clean test -Dtests.slow=false %s' % (javaExe('1.7'), testArgs), '%s/test.log' % unpackPath) java.run_java7('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath)
# test javadocs # test javadocs
print(' generate javadocs w/ Java 7...') print(' generate javadocs w/ Java 7...')
run('%s; ant clean javadocs' % javaExe('1.7'), '%s/javadocs.log' % unpackPath) java.run_java7('ant clean javadocs', '%s/javadocs.log' % unpackPath)
checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False) checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False)
print(' test solr example w/ Java 7...') print(' test solr example w/ Java 7...')
run('%s; ant clean example' % javaExe('1.7'), '%s/antexample.log' % unpackPath) java.run_java7('ant clean example', '%s/antexample.log' % unpackPath)
testSolrExample(unpackPath, JAVA7_HOME, True) testSolrExample(unpackPath, java.java7_home, True)
os.chdir('..')
if java.run_java8:
print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs)
java.run_java8('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath)
print(' generate javadocs w/ Java 8...')
java.run_java8('ant clean javadocs', '%s/javadocs.log' % unpackPath)
checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False)
print(' test solr example w/ Java 8...')
java.run_java8('ant clean example', '%s/antexample.log' % unpackPath)
testSolrExample(unpackPath, java.java8_home, True)
os.chdir('..')
print(' check NOTICE') print(' check NOTICE')
testNotice(unpackPath) testNotice(unpackPath)
@ -763,28 +762,39 @@ def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs
checkAllJARs(os.getcwd(), project, svnRevision, version, tmpDir, baseURL) checkAllJARs(os.getcwd(), project, svnRevision, version, tmpDir, baseURL)
if project == 'lucene': if project == 'lucene':
testDemo(isSrc, version, '1.7') testDemo(java.run_java7, isSrc, version, '1.7')
if java.run_java8:
testDemo(java.run_java8, isSrc, version, '1.8')
print(' check Lucene\'s javadoc JAR')
checkJavadocpath('%s/docs' % unpackPath)
else: else:
checkSolrWAR('%s/example/webapps/solr.war' % unpackPath, svnRevision, version, tmpDir, baseURL) checkSolrWAR('%s/example/webapps/solr.war' % unpackPath, svnRevision, version, tmpDir, baseURL)
print(' copying unpacked distribution for Java 7 ...') print(' copying unpacked distribution for Java 7 ...')
java7UnpackPath = '%s-java7' %unpackPath java7UnpackPath = '%s-java7' % unpackPath
if os.path.exists(java7UnpackPath): if os.path.exists(java7UnpackPath):
shutil.rmtree(java7UnpackPath) shutil.rmtree(java7UnpackPath)
shutil.copytree(unpackPath, java7UnpackPath) shutil.copytree(unpackPath, java7UnpackPath)
os.chdir(java7UnpackPath) os.chdir(java7UnpackPath)
print(' test solr example w/ Java 7...') print(' test solr example w/ Java 7...')
testSolrExample(java7UnpackPath, JAVA7_HOME, False) testSolrExample(java7UnpackPath, java.java7_home, False)
if java.run_java8:
print(' copying unpacked distribution for Java 8 ...')
java8UnpackPath = '%s-java8' % unpackPath
if os.path.exists(java8UnpackPath):
shutil.rmtree(java8UnpackPath)
shutil.copytree(unpackPath, java8UnpackPath)
os.chdir(java8UnpackPath)
print(' test solr example w/ Java 8...')
testSolrExample(java8UnpackPath, java.java8_home, False)
os.chdir(unpackPath) os.chdir(unpackPath)
testChangesText('.', version, project) testChangesText('.', version, project)
if project == 'lucene' and not isSrc:
print(' check Lucene\'s javadoc JAR')
checkJavadocpath('%s/docs' % unpackPath)
def testNotice(unpackPath): def testNotice(unpackPath):
solrNotice = open('%s/NOTICE.txt' % unpackPath, encoding='UTF-8').read() solrNotice = open('%s/NOTICE.txt' % unpackPath, encoding='UTF-8').read()
luceneNotice = open('%s/lucene/NOTICE.txt' % unpackPath, encoding='UTF-8').read() luceneNotice = open('%s/lucene/NOTICE.txt' % unpackPath, encoding='UTF-8').read()
@ -918,7 +928,7 @@ def checkJavadocpathFull(path, failOnMissing=True):
if checkJavadocLinks.checkAll(path): if checkJavadocLinks.checkAll(path):
raise RuntimeError('broken javadocs links found!') raise RuntimeError('broken javadocs links found!')
def testDemo(isSrc, version, jdk): def testDemo(run_java, isSrc, version, jdk):
if os.path.exists('index'): if os.path.exists('index'):
shutil.rmtree('index') # nuke any index from any previous iteration shutil.rmtree('index') # nuke any index from any previous iteration
@ -930,8 +940,8 @@ def testDemo(isSrc, version, jdk):
else: else:
cp = 'core/lucene-core-{0}.jar{1}demo/lucene-demo-{0}.jar{1}analysis/common/lucene-analyzers-common-{0}.jar{1}queryparser/lucene-queryparser-{0}.jar'.format(version, sep) cp = 'core/lucene-core-{0}.jar{1}demo/lucene-demo-{0}.jar{1}analysis/common/lucene-analyzers-common-{0}.jar{1}queryparser/lucene-queryparser-{0}.jar'.format(version, sep)
docsDir = 'docs' docsDir = 'docs'
run('%s; java -cp "%s" org.apache.lucene.demo.IndexFiles -index index -docs %s' % (javaExe(jdk), cp, docsDir), 'index.log') run_java('java -cp "%s" org.apache.lucene.demo.IndexFiles -index index -docs %s' % (cp, docsDir), 'index.log')
run('%s; java -cp "%s" org.apache.lucene.demo.SearchFiles -index index -query lucene' % (javaExe(jdk), cp), 'search.log') run_java('java -cp "%s" org.apache.lucene.demo.SearchFiles -index index -query lucene' % cp, 'search.log')
reMatchingDocs = re.compile('(\d+) total matching documents') reMatchingDocs = re.compile('(\d+) total matching documents')
m = reMatchingDocs.search(open('search.log', encoding='UTF-8').read()) m = reMatchingDocs.search(open('search.log', encoding='UTF-8').read())
if m is None: if m is None:
@ -942,7 +952,7 @@ def testDemo(isSrc, version, jdk):
raise RuntimeError('lucene demo\'s SearchFiles found too few results: %s' % numHits) raise RuntimeError('lucene demo\'s SearchFiles found too few results: %s' % numHits)
print(' got %d hits for query "lucene"' % numHits) print(' got %d hits for query "lucene"' % numHits)
print(' checkindex with %s...' % jdk) print(' checkindex with %s...' % jdk)
run('%s; java -ea -cp "%s" org.apache.lucene.index.CheckIndex index' % (javaExe(jdk), cp), 'checkindex.log') run_java('java -ea -cp "%s" org.apache.lucene.index.CheckIndex index' % cp, 'checkindex.log')
s = open('checkindex.log').read() s = open('checkindex.log').read()
m = re.search(r'^\s+version=(.*?)$', s, re.MULTILINE) m = re.search(r'^\s+version=(.*?)$', s, re.MULTILINE)
if m is None: if m is None:
@ -1250,6 +1260,31 @@ def crawl(downloadedFiles, urlString, targetDir, exclusions=set()):
downloadedFiles.append(path) downloadedFiles.append(path)
sys.stdout.write('.') sys.stdout.write('.')
def make_java_config(parser, java8_home):
def _make_runner(java_home, version):
print('Java %s JAVA_HOME=%s' % (version, java_home))
if cygwin:
java_home = subprocess.check_output('cygpath -u "%s"' % java_home).read().decode('utf-8').strip()
cmd_prefix = 'export JAVA_HOME="%s" PATH="%s/bin:$PATH" JAVACMD="%s/bin/java"' % \
(java_home, java_home, java_home)
s = subprocess.check_output('%s; java -version' % cmd_prefix,
shell=True, stderr=subprocess.STDOUT).decode('utf-8')
if s.find(' version "%s.' % version) == -1:
parser.error('got wrong version for java %s:\n%s' % (version, s))
def run_java(cmd, logfile):
run('%s; %s' % (cmd_prefix, cmd), logfile)
return run_java
java7_home = os.environ.get('JAVA_HOME')
if java7_home is None:
parser.error('JAVA_HOME must be set')
run_java7 = _make_runner(java7_home, '1.7')
run_java8 = None
if java8_home is not None:
run_java8 = _make_runner(java8_home, '1.8')
jc = namedtuple('JavaConfig', 'run_java7 java7_home run_java8 java8_home')
return jc(run_java7, java7_home, run_java8, java8_home)
version_re = re.compile(r'(\d+\.\d+\.\d+(-ALPHA|-BETA)?)') version_re = re.compile(r'(\d+\.\d+\.\d+(-ALPHA|-BETA)?)')
revision_re = re.compile(r'rev(\d+)') revision_re = re.compile(r'rev(\d+)')
def parse_config(): def parse_config():
@ -1268,9 +1303,11 @@ def parse_config():
help='SVN revision number that release was built with, defaults to that in URL') help='SVN revision number that release was built with, defaults to that in URL')
parser.add_argument('--version', metavar='X.Y.Z(-ALPHA|-BETA)?', parser.add_argument('--version', metavar='X.Y.Z(-ALPHA|-BETA)?',
help='Version of the release, defaults to that in URL') help='Version of the release, defaults to that in URL')
parser.add_argument('--test-java8', metavar='JAVA8_HOME',
help='Path to Java8 home directory, to run tests with if specified')
parser.add_argument('url', help='Url pointing to release to test') parser.add_argument('url', help='Url pointing to release to test')
parser.add_argument('test_args', nargs=argparse.REMAINDER, metavar='ARGS', parser.add_argument('test_args', nargs=argparse.REMAINDER,
help='Arguments to pass to ant for testing, e.g. -Dwhat=ever') help='Arguments to pass to ant for testing, e.g. -Dwhat=ever.')
c = parser.parse_args() c = parser.parse_args()
if c.version is not None: if c.version is not None:
@ -1287,6 +1324,8 @@ def parse_config():
if revision_match is None: if revision_match is None:
parser.error('Could not find revision in URL') parser.error('Could not find revision in URL')
c.revision = revision_match.group(1) c.revision = revision_match.group(1)
c.java = make_java_config(parser, c.test_java8)
if c.tmp_dir: if c.tmp_dir:
c.tmp_dir = os.path.abspath(c.tmp_dir) c.tmp_dir = os.path.abspath(c.tmp_dir)
@ -1303,9 +1342,9 @@ def parse_config():
def main(): def main():
c = parse_config() c = parse_config()
print('NOTE: output encoding is %s' % sys.stdout.encoding) print('NOTE: output encoding is %s' % sys.stdout.encoding)
smokeTest(c.url, c.revision, c.version, c.tmp_dir, c.is_signed, ' '.join(c.test_args)) smokeTest(c.java, c.url, c.revision, c.version, c.tmp_dir, c.is_signed, ' '.join(c.test_args))
def smokeTest(baseURL, svnRevision, version, tmpDir, isSigned, testArgs): def smokeTest(java, baseURL, svnRevision, version, tmpDir, isSigned, testArgs):
startTime = datetime.datetime.now() startTime = datetime.datetime.now()
@ -1340,15 +1379,15 @@ def smokeTest(baseURL, svnRevision, version, tmpDir, isSigned, testArgs):
print('Test Lucene...') print('Test Lucene...')
checkSigs('lucene', lucenePath, version, tmpDir, isSigned) checkSigs('lucene', lucenePath, version, tmpDir, isSigned)
for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version): for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version):
unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version, testArgs, baseURL) unpackAndVerify(java, 'lucene', tmpDir, artifact, svnRevision, version, testArgs, baseURL)
unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL) unpackAndVerify(java, 'lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL)
print() print()
print('Test Solr...') print('Test Solr...')
checkSigs('solr', solrPath, version, tmpDir, isSigned) checkSigs('solr', solrPath, version, tmpDir, isSigned)
for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version): for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version):
unpackAndVerify('solr', tmpDir, artifact, svnRevision, version, testArgs, baseURL) unpackAndVerify(java, 'solr', tmpDir, artifact, svnRevision, version, testArgs, baseURL)
unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL) unpackAndVerify(java, 'solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs, baseURL)
print() print()
print('Test Maven artifacts for Lucene and Solr...') print('Test Maven artifacts for Lucene and Solr...')

View File

@ -127,6 +127,11 @@ Bug Fixes
MockDirectoryWrapper to have it simulate a virus checker holding a MockDirectoryWrapper to have it simulate a virus checker holding a
file open and preventing deletion (Robert Muir, Mike McCandless) file open and preventing deletion (Robert Muir, Mike McCandless)
Build
* LUCENE-5909: Smoke tester now has better command line parsing and
optionally also runs on Java 8. (Ryan Ernst, Uwe Schindler)
======================= Lucene 4.10.0 ====================== ======================= Lucene 4.10.0 ======================
New Features New Features