Index: build.xml =================================================================== --- build.xml (revision 1484126) +++ build.xml (working copy) @@ -268,6 +268,7 @@ + @@ -311,6 +312,8 @@ + + Index: dev-tools/scripts/buildAndPushRelease.py =================================================================== --- dev-tools/scripts/buildAndPushRelease.py (revision 1484126) +++ dev-tools/scripts/buildAndPushRelease.py (working copy) @@ -310,7 +310,7 @@ if smokeTmpDir is not None: import smokeTestRelease smokeTestRelease.DEBUG = False - smokeTestRelease.smokeTest(url, rev, version, smokeTmpDir, gpgKeyID is not None) + smokeTestRelease.smokeTest(url, rev, version, smokeTmpDir, gpgKeyID is not None, '') if __name__ == '__main__': try: Index: dev-tools/scripts/smokeTestRelease.py =================================================================== --- dev-tools/scripts/smokeTestRelease.py (revision 1484126) +++ dev-tools/scripts/smokeTestRelease.py (working copy) @@ -584,7 +584,7 @@ if text == 'Parent Directory' or text == '..': return links[(i+1):] -def unpackAndVerify(project, tmpDir, artifact, svnRevision, version): +def unpackAndVerify(project, tmpDir, artifact, svnRevision, version, testArgs): destDir = '%s/unpack' % tmpDir if os.path.exists(destDir): shutil.rmtree(destDir) @@ -604,14 +604,14 @@ raise RuntimeError('unpack produced entries %s; expected only %s' % (l, expected)) unpackPath = '%s/%s' % (destDir, expected) - verifyUnpacked(project, artifact, unpackPath, svnRevision, version, tmpDir) + verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs) LUCENE_NOTICE = None LUCENE_LICENSE = None SOLR_NOTICE = None SOLR_LICENSE = None -def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, tmpDir): +def verifyUnpacked(project, artifact, unpackPath, svnRevision, version, testArgs): global LUCENE_NOTICE global LUCENE_LICENSE global SOLR_NOTICE @@ -698,8 +698,8 @@ run('%s; ant validate' % javaExe('1.7'), '%s/validate.log' % unpackPath) if project == 'lucene': - print(' run tests w/ Java 6...') - run('%s; ant test' % javaExe('1.6'), '%s/test.log' % unpackPath) + print(" run tests w/ Java 6 and testArgs='%s'..." % testArgs) + run('%s; ant test %s' % (javaExe('1.6'), testArgs), '%s/test.log' % unpackPath) run('%s; ant jar' % javaExe('1.6'), '%s/compile.log' % unpackPath) testDemo(isSrc, version, '1.6') # test javadocs @@ -707,8 +707,8 @@ run('%s; ant javadocs' % javaExe('1.6'), '%s/javadocs.log' % unpackPath) checkJavadocpath('%s/build/docs' % unpackPath) - print(' run tests w/ Java 7...') - run('%s; ant clean test' % javaExe('1.7'), '%s/test.log' % unpackPath) + print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs) + run('%s; ant clean test %s' % (javaExe('1.7'), testArgs), '%s/test.log' % unpackPath) run('%s; ant jar' % javaExe('1.7'), '%s/compile.log' % unpackPath) testDemo(isSrc, version, '1.7') @@ -728,8 +728,8 @@ checkJavadocpath('%s/solr/build/docs' % unpackPath, False) # DISABLED until solr tests consistently pass - #print(' run tests w/ Java 7...') - #run('%s; ant test' % javaExe('1.7'), '%s/test.log' % unpackPath) + #print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs) + #run('%s; ant clean test %s' % (javaExe('1.7'), testArgs), '%s/test.log' % unpackPath) # test javadocs print(' generate javadocs w/ Java 7...') @@ -1349,7 +1349,8 @@ if len(sys.argv) < 5: print() - print('Usage python -u %s BaseURL SvnRevision version tmpDir' % sys.argv[0]) + print('Usage python -u %s BaseURL SvnRevision version tmpDir [ isSigned ] [ -testArgs "-Dwhat=ever [ ... ]" ]' + % sys.argv[0]) print() print(' example: python3.2 -u dev-tools/scripts/smokeTestRelease.py http://people.apache.org/~whoever/staging_area/lucene-solr-4.3.0-RC1-rev1469340 1469340 4.3.0 /path/to/a/tmp/dir') print() @@ -1362,15 +1363,38 @@ if not reAllowedVersion.match(version): raise RuntimeError('version "%s" does not match format X.Y.Z[-ALPHA|-BETA]' % version) - tmpDir = os.path.abspath(sys.argv[4]) - isSigned = True - if len(sys.argv) == 6: - isSigned = (sys.argv[5] == "True") + tmpDirArgNum = 4 + tmpDir = os.path.abspath(sys.argv[tmpDirArgNum]) - smokeTest(baseURL, svnRevision, version, tmpDir, isSigned) + # TODO: yuck: positional-only args with more than one optional arg totally sucks + # TODO: consider naming all args + isSigned = True + testArgs = '' + lastArgNum = len(sys.argv) - 1 + if lastArgNum > tmpDirArgNum: + nextArgNum = tmpDirArgNum + 1 + if sys.argv[nextArgNum] == '-testArgs': + if nextArgNum == lastArgNum: + raise RuntimeError('missing expected argument to -testArgs') + else: + # TODO: should there be arg validation here? E.g. starts with '-D'? + testArgs = sys.argv[nextArgNum + 1] + nextArgNum += 2 + if nextArgNum <= lastArgNum: + isSigned = (sys.argv[nextArgNum] == "True") + nextArgNum += 1 + if nextArgNum <= lastArgNum and testArgs == '': + if sys.argv[nextArgNum] == '-testArgs': + if nextArgNum == lastArgNum: + raise RuntimeError('missing expected argument to -testArgs') + else: + # TODO: should there be arg validation here? E.g. starts with '-D'? + testArgs = sys.argv[nextArgNum + 1] -def smokeTest(baseURL, svnRevision, version, tmpDir, isSigned): + smokeTest(baseURL, svnRevision, version, tmpDir, isSigned, testArgs) +def smokeTest(baseURL, svnRevision, version, tmpDir, isSigned, testArgs): + startTime = datetime.datetime.now() if FORCE_CLEAN: @@ -1404,15 +1428,15 @@ print('Test Lucene...') checkSigs('lucene', lucenePath, version, tmpDir, isSigned) for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version): - unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version) - unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version) + unpackAndVerify('lucene', tmpDir, artifact, svnRevision, version, testArgs) + unpackAndVerify('lucene', tmpDir, 'lucene-%s-src.tgz' % version, svnRevision, version, testArgs) print() print('Test Solr...') checkSigs('solr', solrPath, version, tmpDir, isSigned) for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version): - unpackAndVerify('solr', tmpDir, artifact, svnRevision, version) - unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version) + unpackAndVerify('solr', tmpDir, artifact, svnRevision, version, testArgs) + unpackAndVerify('solr', tmpDir, 'solr-%s-src.tgz' % version, svnRevision, version, testArgs) print() print('Test Maven artifacts for Lucene and Solr...')