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' if checkJavadocLinks.checkAll(path): raise RuntimeError('broken javadocs links found!')
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('.'): # disabled: RM cannot fix all this, see LUCENE-3887 # raise RuntimeError('javadoc problems') print '\n***WARNING***: javadocs want to fail!\n' os.chdir(unpackPath)
def verifyUnpacked(project, artifact, unpackPath, version, tmpDir): os.chdir(unpackPath) isSrc = artifact.find('-src') != -1 l = os.listdir(unpackPath) textFiles = ['LICENSE', 'NOTICE', 'README'] if project == 'lucene': textFiles.extend(('JRE_VERSION_MIGRATION', 'CHANGES')) if isSrc: textFiles.append('BUILD') for fileName in textFiles: fileName += '.txt' if fileName not in l: raise RuntimeError('file "%s" is missing from artifact %s' % (fileName, artifact)) l.remove(fileName) if not isSrc: if project == 'lucene': expectedJARs = ('lucene-core-%s' % version, 'lucene-core-%s-javadoc' % version, 'lucene-test-framework-%s' % version, 'lucene-test-framework-%s-javadoc' % version) else: expectedJARs = () for fileName in expectedJARs: fileName += '.jar' if fileName not in l: raise RuntimeError('%s: file "%s" is missing from artifact %s' % (project, fileName, artifact)) l.remove(fileName) if project == 'lucene': extras = ('test-framework', 'docs', 'contrib') if isSrc: extras += ('build.xml', 'index.html', 'common-build.xml', 'core', 'backwards', 'tools', 'site') else: extras = () for e in extras: if e not in l: raise RuntimeError('%s: %s missing from artifact %s' % (project, e, artifact)) l.remove(e) if project == 'lucene': if len(l) > 0: raise RuntimeError('%s: unexpected files/dirs in artifact %s: %s' % (project, artifact, l)) if isSrc: print ' make sure no JARs/WARs in src dist...' lines = os.popen('find . -name \\*.jar').readlines() if len(lines) != 0: print ' FAILED:' for line in lines: print ' %s' % line.strip() raise RuntimeError('source release has JARs...') lines = os.popen('find . -name \\*.war').readlines() if len(lines) != 0: print ' FAILED:' for line in lines: print ' %s' % line.strip() raise RuntimeError('source release has WARs...') print ' run "ant validate"' run('%s; ant validate' % javaExe('1.7'), '%s/validate.log' % unpackPath) print ' run "ant rat-sources"' run('%s; ant -lib %s/apache-rat-0.8.jar/apache-rat-0.8/apache-rat-0.8.jar 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) 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') 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) 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) os.chdir('solr') print ' test solr example w/ Java 6...' run('%s; ant clean example' % javaExe('1.6'), '%s/antexample.log' % unpackPath) testSolrExample(unpackPath, JAVA6_HOME, True) print ' test solr example w/ Java 7...' run('%s; ant clean example' % javaExe('1.7'), '%s/antexample.log' % unpackPath) testSolrExample(unpackPath, JAVA7_HOME, True) os.chdir('..') print ' check NOTICE' testNotice(unpackPath) else: if project == 'lucene': testDemo(isSrc, version) else: print ' test solr example w/ Java 6...' testSolrExample(unpackPath, JAVA6_HOME, False) print ' test solr example w/ Java 7...' testSolrExample(unpackPath, JAVA7_HOME, False) testChangesText('.', version, project) if project == 'lucene' and not isSrc: print ' check Lucene\'s javadoc JAR' unpackJavadocsJar('%s/lucene-core-%s-javadoc.jar' % (unpackPath, version), unpackPath)
def verifyUnpacked(project, artifact, unpackPath, version, tmpDir): os.chdir(unpackPath) isSrc = artifact.find('-src') != -1 l = os.listdir(unpackPath) textFiles = ['LICENSE', 'NOTICE', 'README'] if project == 'lucene': textFiles.extend(('JRE_VERSION_MIGRATION', 'CHANGES')) if isSrc: textFiles.append('BUILD') for fileName in textFiles: fileName += '.txt' if fileName not in l: raise RuntimeError('file "%s" is missing from artifact %s' % (fileName, artifact)) l.remove(fileName) if not isSrc: if project == 'lucene': expectedJARs = ('lucene-core-%s' % version, 'lucene-core-%s-javadoc' % version, 'lucene-test-framework-%s' % version, 'lucene-test-framework-%s-javadoc' % version) else: expectedJARs = () for fileName in expectedJARs: fileName += '.jar' if fileName not in l: raise RuntimeError('%s: file "%s" is missing from artifact %s' % (project, fileName, artifact)) l.remove(fileName) if project == 'lucene': extras = ('test-framework', 'docs', 'contrib') if isSrc: extras += ('build.xml', 'index.html', 'common-build.xml', 'core', 'backwards', 'tools', 'site') else: extras = () for e in extras: if e not in l: raise RuntimeError('%s: %s missing from artifact %s' % (project, e, artifact)) l.remove(e) if project == 'lucene': if len(l) > 0: raise RuntimeError('%s: unexpected files/dirs in artifact %s: %s' % (project, artifact, l)) if isSrc: print ' make sure no JARs/WARs in src dist...' lines = os.popen('find . -name \\*.jar').readlines() if len(lines) != 0: print ' FAILED:' for line in lines: print ' %s' % line.strip() raise RuntimeError('source release has JARs...') lines = os.popen('find . -name \\*.war').readlines() if len(lines) != 0: print ' FAILED:' for line in lines: print ' %s' % line.strip() raise RuntimeError('source release has WARs...') print ' run "ant validate"' run('%s; ant validate' % javaExe('1.7'), '%s/validate.log' % unpackPath) print ' run "ant rat-sources"' run('%s; ant -lib %s/apache-rat-0.8.jar 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) 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') 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) 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) os.chdir('solr') print ' test solr example w/ Java 6...' run('%s; ant clean example' % javaExe('1.6'), '%s/antexample.log' % unpackPath) testSolrExample(unpackPath, JAVA6_HOME, True) print ' test solr example w/ Java 7...' run('%s; ant clean example' % javaExe('1.7'), '%s/antexample.log' % unpackPath) testSolrExample(unpackPath, JAVA7_HOME, True) os.chdir('..') print ' check NOTICE' testNotice(unpackPath) else: if project == 'lucene': testDemo(isSrc, version) else: print ' test solr example w/ Java 6...' testSolrExample(unpackPath, JAVA6_HOME, False) print ' test solr example w/ Java 7...' testSolrExample(unpackPath, JAVA7_HOME, False) testChangesText('.', version, project) if project == 'lucene' and not isSrc: print ' check Lucene\'s javadoc JAR' unpackJavadocsJar('%s/lucene-core-%s-javadoc.jar' % (unpackPath, version), unpackPath)