Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96892CE96 for ; Fri, 8 Jun 2012 10:17:33 +0000 (UTC) Received: (qmail 9155 invoked by uid 500); 8 Jun 2012 10:17:32 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 9134 invoked by uid 99); 8 Jun 2012 10:17:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 10:17:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 10:17:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C93F92388860; Fri, 8 Jun 2012 10:17:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1348008 - in /lucene/dev/branches/branch_4x/dev-tools/scripts: checkJavadocLinks.py smokeTestRelease.py Date: Fri, 08 Jun 2012 10:17:08 -0000 To: commits@lucene.apache.org From: rmuir@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120608101708.C93F92388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rmuir Date: Fri Jun 8 10:17:08 2012 New Revision: 1348008 URL: http://svn.apache.org/viewvc?rev=1348008&view=rev Log: smokeTester: nuke java 1.5 tests, check for broken links, enforce working package summaries Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py?rev=1348008&r1=1348007&r2=1348008&view=diff ============================================================================== --- lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py (original) +++ lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py Fri Jun 8 10:17:08 2012 @@ -209,14 +209,13 @@ def checkAll(dirName): print ' BROKEN ANCHOR: %s' % origLink failures = failures or printed - - if failures: + + return failures + +if __name__ == '__main__': + if checkAll(sys.argv[1]): print print 'Broken javadocs links were found!' sys.exit(1) - else: - sys.exit(0) - -if __name__ == '__main__': - checkAll(sys.argv[1]) + sys.exit(0) Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py?rev=1348008&r1=1348007&r2=1348008&view=diff ============================================================================== --- lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py (original) +++ lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py Fri Jun 8 10:17:08 2012 @@ -31,6 +31,7 @@ import xml.etree.ElementTree as ET import filecmp import platform import checkJavaDocs +import checkJavadocLinks # 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 @@ -47,9 +48,7 @@ def unshortenURL(url): return url def javaExe(version): - if version == '1.5': - path = JAVA5_HOME - elif version == '1.6': + if version == '1.6': path = JAVA6_HOME elif version == '1.7': path = JAVA7_HOME @@ -65,11 +64,6 @@ def verifyJavaVersion(version): # http://s.apache.org/lusolr32rc2 env = os.environ try: - JAVA5_HOME = env['JAVA5_HOME'] -except KeyError: - JAVA5_HOME = '/usr/local/jdk1.5.0_22' - -try: JAVA6_HOME = env['JAVA6_HOME'] except KeyError: JAVA6_HOME = '/usr/local/jdk1.6.0_27' @@ -79,7 +73,6 @@ try: except KeyError: JAVA7_HOME = '/usr/local/jdk1.7.0_01' -verifyJavaVersion('1.5') verifyJavaVersion('1.6') verifyJavaVersion('1.7') @@ -321,7 +314,7 @@ def checkChangesContent(s, version, name sub = version if s.find(sub) == -1: - # contrib/benchmark never seems to include release info: + # benchmark never seems to include release info: if name.find('/benchmark/') == -1: raise RuntimeError('did not see "%s" in %s' % (sub, name)) @@ -491,31 +484,27 @@ def verifyUnpacked(project, artifact, un run('%s; ant -lib "%s/apache-rat-0.8.jar/apache-rat-0.8" rat-sources' % (javaExe('1.7'), tmpDir), '%s/rat-sources.log' % unpackPath) if project == 'lucene': - print ' run tests w/ Java 5...' - run('%s; ant test' % javaExe('1.5'), '%s/test.log' % unpackPath) - run('%s; ant jar' % javaExe('1.5'), '%s/compile.log' % unpackPath) + print ' run tests w/ Java 6...' + run('%s; ant test' % javaExe('1.6'), '%s/test.log' % unpackPath) + run('%s; ant jar' % javaExe('1.6'), '%s/compile.log' % unpackPath) testDemo(isSrc, version) # test javadocs - print ' generate javadocs w/ Java 5...' - run('%s; ant javadocs' % javaExe('1.5'), '%s/javadocs.log' % unpackPath) - if checkJavaDocs.checkPackageSummaries('build/docs/api'): - print '\n***WARNING***: javadocs want to fail!\n' - # disabled: RM cannot fix all this, see LUCENE-3887 - #raise RuntimeError('javadoc summaries failed') + print ' generate javadocs w/ Java 6...' + run('%s; ant javadocs-lint' % javaExe('1.6'), '%s/javadocs.log' % unpackPath) else: print ' run tests w/ Java 6...' run('%s; ant test' % javaExe('1.6'), '%s/test.log' % unpackPath) # test javadocs print ' generate javadocs w/ Java 6...' - run('%s; ant javadocs' % javaExe('1.6'), '%s/javadocs.log' % unpackPath) + run('%s; ant javadocs-lint' % javaExe('1.6'), '%s/javadocs.log' % unpackPath) print ' run tests w/ Java 7...' run('%s; ant test' % javaExe('1.7'), '%s/test.log' % unpackPath) # test javadocs print ' generate javadocs w/ Java 7...' - run('%s; ant javadocs' % javaExe('1.7'), '%s/javadocs.log' % unpackPath) + run('%s; ant javadocs-lint' % javaExe('1.7'), '%s/javadocs.log' % unpackPath) os.chdir('solr') print ' test solr example w/ Java 6...' @@ -544,7 +533,7 @@ def verifyUnpacked(project, artifact, un if project == 'lucene' and not isSrc: print ' check Lucene\'s javadoc JAR' - unpackJavadocsJar('%s/lucene-core-%s-javadoc.jar' % (unpackPath, version), unpackPath) + checkJavadocpath('%s/docs' % unpackPath) def testNotice(unpackPath): solrNotice = open('%s/NOTICE.txt' % unpackPath).read() @@ -626,18 +615,20 @@ def testSolrExample(unpackPath, javaPath os.chdir('..') -def unpackJavadocsJar(jarPath, unpackPath): - destDir = '%s/javadocs' % unpackPath - if os.path.exists(destDir): - shutil.rmtree(destDir) - os.makedirs(destDir) - os.chdir(destDir) - run('unzip %s' % jarPath, '%s/unzip.log' % destDir) - if checkJavaDocs.checkPackageSummaries('.'): +def checkJavadocpath(path): + # check for level='package' + # we fail here if its screwed up + if checkJavaDocs.checkPackageSummaries(path, 'package'): + raise RuntimeError('missing javadocs package summaries!') + + # now check for level='class' + if checkJavaDocs.checkPackageSummaries(path): # disabled: RM cannot fix all this, see LUCENE-3887 # raise RuntimeError('javadoc problems') print '\n***WARNING***: javadocs want to fail!\n' - os.chdir(unpackPath) + + if checkJavadocLinks.checkAll(path): + raise RuntimeError('broken javadocs links found!') def testDemo(isSrc, version): print ' test demo...' @@ -645,16 +636,16 @@ def testDemo(isSrc, version): if isSrc: # allow lucene dev version to be either 3.3 or 3.3.0: if version.endswith('.0'): - cp = 'build/core/lucene-core-{0}-SNAPSHOT.jar{1}build/contrib/demo/classes/java'.format(version, sep) - cp += '{1}build/core/lucene-core-{0}-SNAPSHOT.jar{1}build/contrib/demo/classes/java'.format(version[:-2], sep) + cp = 'build/core/lucene-core-{0}-SNAPSHOT.jar{1}build/demo/classes/java'.format(version, sep) + cp += '{1}build/core/lucene-core-{0}-SNAPSHOT.jar{1}build/demo/classes/java'.format(version[:-2], sep) else: - cp = 'build/core/lucene-core-{0}-SNAPSHOT.jar{1}build/contrib/demo/classes/java'.format(version, sep) + cp = 'build/core/lucene-core-{0}-SNAPSHOT.jar{1}build/demo/classes/java'.format(version, sep) docsDir = 'core/src' else: - cp = 'lucene-core-{0}.jar{1}contrib/demo/lucene-demo-{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' - run('%s; java -cp "%s" org.apache.lucene.demo.IndexFiles -index index -docs %s' % (javaExe('1.5'), cp, docsDir), 'index.log') - run('%s; java -cp "%s" org.apache.lucene.demo.SearchFiles -index index -query lucene' % (javaExe('1.5'), cp), 'search.log') + run('%s; java -cp "%s" org.apache.lucene.demo.IndexFiles -index index -docs %s' % (javaExe('1.6'), cp, docsDir), 'index.log') + run('%s; java -cp "%s" org.apache.lucene.demo.SearchFiles -index index -query lucene' % (javaExe('1.6'), cp), 'search.log') reMatchingDocs = re.compile('(\d+) total matching documents') m = reMatchingDocs.search(open('search.log', 'rb').read()) if m is None: