Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 84356 invoked from network); 6 Feb 2007 03:19:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2007 03:19:51 -0000 Received: (qmail 69339 invoked by uid 500); 6 Feb 2007 03:19:57 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 69294 invoked by uid 500); 6 Feb 2007 03:19:57 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 69275 invoked by uid 99); 6 Feb 2007 03:19:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2007 19:19:57 -0800 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2007 19:19:49 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8A66D1A981A; Mon, 5 Feb 2007 19:19:29 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r503967 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report: ReportGenerator.groovy resources/class-summary.tmpl resources/package-summary.tmpl Date: Tue, 06 Feb 2007 03:19:29 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070206031929.8A66D1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Mon Feb 5 19:19:28 2007 New Revision: 503967 URL: http://svn.apache.org/viewvc?view=rev&rev=503967 Log: Changes testcase to detail to generate into .html Adding crude support for package and class summaries Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl (with props) geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl (with props) Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy?view=diff&rev=503967&r1=503966&r2=503967 ============================================================================== --- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy (original) +++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy Mon Feb 5 19:19:28 2007 @@ -67,6 +67,12 @@ return props } + def makeSafeFilename(String filename) { + assert filename + + return filename.replace('.', '/').replace('#', '_') + } + def generate() { ant.mkdir(dir: targetDir) @@ -79,18 +85,11 @@ // Setup the template engine def engine = new TemplateEngine('gbuild/config/projects/Geronimo_CTS/report/resources') - // Process each result archive - archives.each { archive -> - log.info "Processing results archive: $archive" - - // Unpack the results - ant.unzip(src: archive, dest: workDir) - - // Load runtests.properties, so we can see webcontainer and iteration (and others) - def props = loadProperties("$workDir/runtests.properties") + def loadTestSuite = { dir -> + log.info "Loading testsuite from: $dir" def scanner = ant.fileScanner { - fileset(dir: workDir) { + fileset(dir: dir) { include(name: '**/*.jtr') } } @@ -111,22 +110,21 @@ log.info "Testsuite loaded in $watch" - // - // TODO: Collect all packages, classes, tests - // - - // - // TODO: Collect global stats (passed, failed, errors, time) - // - - // - // TODO: May want to add some sanity checks to make sure that iterations - // do not have weird matching of stats for packages? - // - - // - // TODO: First thing is to generate the test detail pages - // + return testSuite + } + + // Process each result archive + archives.each { archive -> + log.info "Processing results archive: $archive" + + // Unpack the results + ant.unzip(src: archive, dest: workDir) + + // Load runtests.properties, so we can see webcontainer and iteration (and others) + def props = loadProperties("$workDir/runtests.properties") + + // Load the testuite + def testSuite = loadTestSuite(workDir) def renderTestCase = { testCase -> log.info "Processing testcase: $testCase.name" @@ -134,14 +132,61 @@ def template = engine.getTemplate('testcase.tmpl') template.params.testCase = testCase - def file = new File(targetDir, testCase.name.replace('.', '/').replace('#', '_') + '.html') + def file = new File(targetDir, makeSafeFilename(testCase.className) + '/' + testCase.testName + '.html') ant.mkdir(dir: file.parentFile) template.render(file) } + def testsInClasses = [:] + def classesInPackages = [:] + testSuite.testCases.each { name, testCase -> renderTestCase(testCase) + + def list + + list = testsInClasses[testCase.className] + if (!list) { + list = new HashSet() + testsInClasses[testCase.className] = list + } + list << testCase.name + + list = classesInPackages[testCase.packageName] + if (!list) { + list = new HashSet() + classesInPackages[testCase.packageName] = list + } + list << testCase.className + } + + // Render class summaries + testsInClasses.each { className, testNames -> + log.info "Processing class summary: $className" + + def template = engine.getTemplate('class-summary.tmpl') + template.params.className = className + template.params.testNames = testNames + + def file = new File(targetDir, makeSafeFilename(className) + '/index.html') + ant.mkdir(dir: file.parentFile) + + template.render(file) + } + + // Render package summaries + classesInPackages.each { packageName, classNames -> + log.info "Processing package summary: $packageName" + + def template = engine.getTemplate('package-summary.tmpl') + template.params.packageName = packageName + template.params.classNames = classNames + + def file = new File(targetDir, makeSafeFilename(packageName) + '/index.html') + ant.mkdir(dir: file.parentFile) + + template.render(file) } // Clean up Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl?view=auto&rev=503967 ============================================================================== --- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl (added) +++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl Mon Feb 5 19:19:28 2007 @@ -0,0 +1,43 @@ +<% +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// +// $Id$ +// +%> + + + $className + + +
+

$className

+ + + <% for (testName in testNames) { %> + + <% def basename = testName.substring(testName.lastIndexOf('#') + 1, testName.size()) %> + + + <% } %> +
$testName
+
+ + Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/class-summary.tmpl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl?view=auto&rev=503967 ============================================================================== --- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl (added) +++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl Mon Feb 5 19:19:28 2007 @@ -0,0 +1,43 @@ +<% +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// +// $Id$ +// +%> + + + $packageName + + +
+

$packageName

+ + + <% for (className in classNames) { %> + + <% def basename = className.substring(className.lastIndexOf('.') + 1, className.size()) %> + + + <% } %> +
$className
+
+ + Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/package-summary.tmpl ------------------------------------------------------------------------------ svn:mime-type = text/plain