From: <raj...@us...> - 2007-09-02 14:22:22
|
Revision: 8838 http://cdk.svn.sourceforge.net/cdk/?rev=8838&view=rev Author: rajarshi Date: 2007-09-02 07:22:15 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Added latest version of nightly to this branch Modified Paths: -------------- branches/cdk-1.0.x/tools/nightly.py Modified: branches/cdk-1.0.x/tools/nightly.py =================================================================== --- branches/cdk-1.0.x/tools/nightly.py 2007-09-02 13:36:46 UTC (rev 8837) +++ branches/cdk-1.0.x/tools/nightly.py 2007-09-02 14:22:15 UTC (rev 8838) @@ -327,18 +327,21 @@ else: # cannot xform, so just copy the XML file shutil.copyfile(src, dest) -def writeJunitSummaryHTML(stats): +def writeJunitSummaryHTML(stats, stable=True): + pagetype = 'Stable' + if not stable: pagetype = 'Unstable' + summary = """ <html> <head> - <title>CDK JUnit Test Summary (%s)</title> + <title>CDK JUnit Test Summary (%s) [%s]</title> <style type="text/css"> tr.crash { background-color: #F778A1;} </style> </head> <body> <center> - <h2>CDK JUnit Test Summary (%s)</h2> + <h2>CDK JUnit Test Summary (%s) [%s]</h2> <table border=0 cellspacing=5 cellpadding=3> <thead> <tr> @@ -352,14 +355,16 @@ <tr> <td colspan=5><hr></td> </tr> - """ % (todayNice, todayNice) + """ % (todayNice, pagetype, todayNice, pagetype) totalTest = 0 totalFail = 0 totalError = 0 for entry in stats: - + if stable and (entry[0] == 'experimental' or entry[0] == 'smarts'): continue + if not stable and entry[0] != 'experimental' and entry[0] != 'smarts': continue + if int(entry[1]) != -1: totalTest = totalTest + int(entry[1]) totalFail = totalFail + int(entry[2]) @@ -396,9 +401,14 @@ </center> </body> </html>""" % (totalTest, totalFail, totalError, (float(totalTest-totalFail-totalError)/float(totalTest))*100) + + summary += """ + </center> + </body> + </html>""" return summary -def parseJunitOutput(summaryFile): +def parseJunitOutput(summaryFile, stable=True): f = open(os.path.join(nightly_dir,'test.log'), 'r') stats = [] foundModuleEntry = False @@ -431,7 +441,7 @@ f.close() # get an HTML summary - summary = writeJunitSummaryHTML(stats) + summary = writeJunitSummaryHTML(stats, stable) # write out this HTML fileName = os.path.join(nightly_web, summaryFile) @@ -741,6 +751,10 @@ s = StringIO.StringIO() lines = open(filename, 'r').readlines() lines = string.join(lines) + + ## make some subs to get valid HTML + lines = lines.replace("<","<") + line = lines.replace(">", ">") s.write(""" <html> <body> @@ -783,7 +797,7 @@ if testsuite.find('smiles') != -1: continue print ' Analyzing %s' % (testsuite) - cmd = """java -cp %s emmarun -cp develjar/junit.jar:dist/jar/cdk-test.jar:dist/jar/cdk-svn-%s.jar:dist/jar/cdk-test-svn-%s.jar -ix +org.openscience.cdk.* -r html -sp src junit.textui.TestRunner org.openscience.cdk.test.%s &> tmp.log && cat tmp.log >> ../emma.log""" % (classpath, todayStr, todayStr, testsuite) + cmd = """java -cp %s emmarun -cp develjar/junit-4.3.1.jar:dist/jar/cdk-test.jar:dist/jar/cdk-svn-%s.jar:dist/jar/cdk-test-svn-%s.jar -ix +org.openscience.cdk.* -r html -sp src junit.textui.TestRunner org.openscience.cdk.test.%s &> tmp.log && cat tmp.log >> ../emma.log""" % (classpath, todayStr, todayStr, testsuite) os.system(cmd) if os.path.exists('coverage'): shutil.copytree('coverage', (os.path.join('emma', testsuite))) @@ -964,16 +978,16 @@ sys.exit(-1) # compile the distro - successDist = runAntJob('nice -n 19 ant clean dist-large', 'build.log', 'distro') + successDist = runAntJob('nice -n 19 ant -lib develjar/junit-4.3.1.jar clean dist-large', 'build.log', 'distro') if successDist: # if we compiled, do the rest of the stuff - successTestDist = runAntJob('nice -19 ant dist-test-large', 'testdist.log', 'testdist') - successSrc = runAntJob('nice -19 ant sourcedist', 'srcdist.log', 'srcdist') - successTest = runAntJob('nice -n 19 ant -DrunSlowTests=false test-all', 'test.log', 'test') - successJavadoc = runAntJob('export CLASSPATH && nice -n 19 ant -f javadoc.xml', 'javadoc.log', 'javadoc') - successKeyword = runAntJob('nice -n 19 ant -f doc/javadoc/build.xml keyword.index', 'keyword.log', 'keywords') - successDoccheck = runAntJob('nice -n 19 ant -f javadoc.xml doccheck', 'doccheck.log', 'doccheck') - successPMD = runAntJob('nice -n 19 ant -f pmd.xml pmd', 'pmd.log', 'pmd') - successPMDUnused = runAntJob('nice -n 19 ant -f pmd-unused.xml', 'pmdu.log', 'pmdu') + successTestDist = runAntJob('nice -19 ant -lib develjar/junit-4.3.1.jar dist-test-large', 'testdist.log', 'testdist') + successSrc = runAntJob('nice -19 ant -lib develjar/junit-4.3.1.jar sourcedist', 'srcdist.log', 'srcdist') + successTest = runAntJob('nice -n 19 ant -lib develjar/junit-4.3.1.jar -DrunSlowTests=false test-all', 'test.log', 'test') + successJavadoc = runAntJob('export CLASSPATH && nice -n 19 ant -lib develjar/junit-4.3.1.jar -f javadoc.xml', 'javadoc.log', 'javadoc') + successKeyword = runAntJob('nice -n 19 ant -lib develjar/junit-4.3.1.jar -f doc/javadoc/build.xml keyword.index', 'keyword.log', 'keywords') + successDoccheck = runAntJob('nice -n 19 ant -lib develjar/junit-4.3.1.jar -f javadoc.xml doccheck', 'doccheck.log', 'doccheck') + successPMD = runAntJob('nice -n 19 ant -lib develjar/junit-4.3.1.jar -f pmd.xml pmd', 'pmd.log', 'pmd') + successPMDUnused = runAntJob('nice -n 19 ant -lib develjar/junit-4.3.1.jar -f pmd-unused.xml', 'pmdu.log', 'pmdu') else: # if the distro could not be built, there's not much use doing the other stuff print 'Distro compile failed. Generating error page' srcFile = os.path.join(nightly_dir, 'build.log') @@ -1196,13 +1210,15 @@ # summarize JUnit test results - it will go into nightly_web parseJunitOutput('junitsummary.html') + parseJunitOutput('junitsummary-unstable.html', stable=False) # check whether we can copy the run output and link to the summary if os.path.exists( os.path.join(nightly_dir, 'test.log') ): shutil.copyfile(os.path.join(nightly_dir, 'test.log'), os.path.join(nightly_web, 'test.log')) resultTable.addCell("<a href=\"test.log\">test.log</a>") - resultTable.appendToCell("<a href=\"junitsummary.html\">Summary</a>") + resultTable.appendToCell("<a href=\"junitsummary.html\">Stable</a>") + resultTable.appendToCell("<a href=\"junitsummary-unstable.html\">Unstable</a>") else: resultTable.addCell("<b>FAILED</b>", klass="tdfail") if os.path.exists( os.path.join(nightly_dir, 'test.log') ): @@ -1218,10 +1234,10 @@ # do the code coverage if successTestDist: print ' Performing code coverage' - celltexts = doCodeCoverage() - if celltexts: - resultTable.addRow() - for celltext in celltexts: resultTable.addCell(celltext) + #celltexts = doCodeCoverage() + #if celltexts: + # resultTable.addRow() + # for celltext in celltexts: resultTable.addCell(celltext) else: resultTable.addRow() resultTable.addCell("""Code <a href="http://emma.sourceforge.net/">coverage</a>""") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |