geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r502138 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
Date Thu, 01 Feb 2007 07:03:31 GMT
Author: jdillon
Date: Wed Jan 31 23:03:31 2007
New Revision: 502138

URL: http://svn.apache.org/viewvc?view=rev&rev=502138
Log:
port over more cts config, pending some details

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy?view=diff&rev=502138&r1=502137&r2=502138
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
Wed Jan 31 23:03:31 2007
@@ -41,8 +41,7 @@
         // AH configuration (since 1.2 and 2.0 use differnt versions)
         //
         
-        def workflow = params.require('anthill.workflow')
-        switch (workflow) {
+        switch (params.require('anthill.workflow')) {
             case 'build 1.2':
                 maven.javaVersion = 1.4
                 break
@@ -60,39 +59,279 @@
         exec.executable = 'project/tck-testsuite/runtests'
         
         def args = []
+        args << '--nocolor'
         
-        args << '-nc'
-        args << '-Dmaven.repo.local=repository'
-        args << params.args
+        args << '-w'
+        args << params.require('webcontainer')
+        
+        def repoDir = new File('repository').canonicalFile
+        args << "-Dmaven.repo.local=$repoDir"
+        
+        // If offline is not set or it set but not true, then run offline
+        if (params.offline == null || !params.offline) {
+            args << '--offline'
+        }
+        
+        // Append some extra arguments for 2.0 runtests to generate summary reports
+        switch (params.require('anthill.workflow')) {
+            case 'build 2.0':
+                args << '--summary'
+                break
+        }
+        
+        args << params.require('tests')
         
         exec.execute(args)
     }
     
     def runtestsIteration = {
+        params.tests = '%'
+        
         def cfg = new IterationConfigurator(context)
-        cfg.configFile = 'project/tck-testsuite/iteration.groovy'
+        cfg.configFile = 'project/tck-testsuite/iteration.conf'
         cfg.iteration = params.iteration
-        cfg.applyTo = [ 'args' ]
+        cfg.applyTo = [ 'tests' ]
         cfg.apply()
         
         runtests()
     }
     
     def primeTestsuite = {
-        params.args = '-w jetty nosection'
+        params.webcontainer = 'jetty'
+        params.tests = 'nosuchtest'
+        params.offline = false
         
         runtests()
     }
     
     def collectRuntime = {
-        // TODO
+        def sourceDir = new File('.').canonicalFile
+        log.info "Source dir: $sourceDir"
+        
+        def targetDir = new File('target/runtime').canonicalFile
+        log.info "Target dir: $targetDir"
+        
+        // Collect the harness
+        ant.mkdir(dir: targetDir)
+        ant.copy(todir: targetDir) {
+            fileset(dir: sourceDir) {
+                include(name: 'harness.xml')
+                include(name: 'lib/**')
+                include(name: 'tools/**')
+                // Do not include libraries/** setup will still check out the right version
+            }
+        }
+        
+        // Collect the repository
+        ant.mkdir(dir: "${targetDir}/repository")
+        
+        // Determine the set of artifacts based on the workflow since this will differer
from version to version :-(
+        switch (params.require('anthill.workflow')) {
+            case 'build 1.2':
+                ant.copy(todir: "${targetDir}/repository") {
+                    fileset(dir: "${sourceDir}/repository") {
+                        include(name: 'activeio/**')
+                        include(name: 'ant/**')
+                        include(name: 'axis/**')
+                        include(name: 'avalon-framework/**')
+                        include(name: 'backport-util-concurrent/**')
+                        include(name: 'commons-discovery/**')
+                        include(name: 'commons-logging/**')
+                        include(name: 'commons-jexl/**')
+                        include(name: 'commons-lang/**')
+                        include(name: 'cglib/**')
+                        include(name: 'classworlds/**')
+                        include(name: 'groovy/**')
+                        include(name: 'oro/**')
+                        include(name: 'mx4j/**')
+                        include(name: 'plexus/**')
+                        include(name: 'ognl/**')
+                        include(name: 'stax/**')
+                        include(name: 'regexp/**')
+                        include(name: 'logkit/**')
+                        include(name: 'log4j/**')
+                        include(name: 'mockobjects/**')
+                        include(name: 'javax/**')
+                        include(name: 'junit/**')
+                        include(name: 'jline/**')
+                        include(name: 'org/objectweb/howl/**')
+                        include(name: 'org/codehaus/plexus/**')
+                        include(name: 'org/apache/geronimo/cts/**')
+                        include(name: 'org/apache/geronimo/plugins/**')
+                        include(name: 'org/apache/geronimo/geronimo/**')
+                        include(name: 'org/apache/geronimo/specs/**')
+                        include(name: 'org/apache/geronimo/genesis/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-j2ee/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-activemq-gbean/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-naming/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-management/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-transaction/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-security/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-kernel/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-activemq-gbean-management/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-connector/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-system/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-common/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-util/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-deploy-jsr88/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-deploy-config/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-deployment/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-interceptor/**')
+                        include(name: 'org/apache/geronimo/modules/geronimo-core/**')
+                        include(name: 'org/apache/geronimo/modules/modules/**')
+                        include(name: 'org/apache/activemq/**')
+                        include(name: 'org/apache/maven/**')
+                        include(name: 'org/apache/xbean/**')
+                        include(name: 'org/apache/apache/**')
+                        include(name: 'com/sun/j2eetck/**')
+                        include(name: 'com/jcraft/jsch/**')
+                        include(name: 'velocity/**')
+                        include(name: 'xstream/**')
+                        include(name: 'xmlbeans/**')
+                        include(name: 'xpp3/**')
+                        include(name: 'xml-resolver/**')
+                    }
+                }
+                break
+            
+            case 'build 2.0':
+                fail("TODO: Need to figure out what the set of dependencies are required
for running tests for 2.0")
+                break
+        }
+        
+        // Collect the project
+        ant.mkdir(dir: "${targetDir}/project")
+        ant.copy(todir: "${targetDir}/project") {
+            fileset(dir: "${sourceDir}/project") {
+                include(name: '*')
+                include(name: 'tck-testsuite/**')
+                
+                // Make sure we don't get any target muck
+                exclude(name: '**/target/**')
+            }
+        }
     }
     
     def collectResults = {
         // TODO
+        
+        /*
+        class postprocess
+            extends CommandSupport
+        {
+            int iteration
+            
+            int workflowId
+            
+            def sourceDir
+            
+            def targetDir
+            
+            def execute() {
+                iteration = context.getRequiredAsInt('iteration')
+                println "Iteration: ${iteration}"
+                
+                workflowId = context.getRequiredAsInt('workflow_id')
+                println "Using workflow ID: ${workflowId}"
+                
+                sourceDir = context.getRequiredAsFile('source_dir')
+                println "Using source dir: ${sourceDir}"
+                assert sourceDir.exists() : "Missing source dir: ${sourceDir}"
+                
+                targetDir = context.resolveFile("reports/tck/${workflowId}/${iteration}")
+                println "Using target dir: ${targetDir}"
+                ant.mkdir(dir: targetDir)
+                
+                // Copy test output to be saved/remoted
+                ant.copy(todir: targetDir) {
+                    fileset(dir: sourceDir) {
+                        include(name: 'logs/**')
+                        include(name: 'summary.properties')
+                        
+                        //
+                        // TODO: Shall we also include the javatest output too?
+                        //
+                    }
+                }
+            }
+        }
+        */
     }
     
     def generateReport = {
         // TODO
+        
+        /*
+        int workflowId
+        
+        def sections
+        
+        def inputDir
+        
+        def reportDir
+        
+        def execute() {
+            workflowId = context.getRequiredAsInt('workflow_id')
+            println "Using workflow ID: ${workflowId}"
+            
+            sections = context.getRequiredAsFile('sections')
+            println "Using sections file: ${sections}"
+            assert sections.exists() : "Missing sections file: ${sections}"
+            
+            inputDir = context.resolveFile("reports/tck/${workflowId}")
+            println "Using input dir: ${inputDir}"
+            assert inputDir.exists() : "Missing report input dir: ${inputDir}"
+            
+            reportDir = context.resolveFile('reports/tck/html')
+            println "Generating reports in dir: ${reportDir}"
+            ant.mkdir(dir: reportDir)
+            
+            // Setup the repository
+            def repoDir = context.resolveFile('repository')
+            println "Using repository: ${repoDir}"
+            
+            // Copy all summary properties to a tempdir for soaking up
+            def summariesDir = context.resolveFile('temp/summaries')
+            ant.mkdir(dir: summariesDir)
+            
+            def scanner = ant.fileScanner {
+                fileset(dir: inputDir) {
+                    include(name: '\*/summary.properties')
+                }
+            }
+            for (file in scanner) {
+                 def uuid = UUID.randomUUID()
+                 ant.copy(file: file, tofile: "${summariesDir}/${uuid}.properties")
+            }
+            
+            //
+            // FIXME: Forward to maven command instead
+            //
+            
+            def mavenHome = context.resolveFile('tools/maven')
+            println "Using MAVEN_HOME: ${mavenHome}"
+            
+            // Generate a report from captured TCK output
+            def runDir = sections.getParentFile() // must run from the dir where sections
props lives
+            ant.exec(executable: "${mavenHome}/bin/mvn", dir: runDir, failonerror: true)
{
+                env(key: 'MAVEN_HOME', value: mavenHome)
+                env(key: 'M2_HOME', value: mavenHome)
+                
+                // Assume that our repo is filled with the right bits
+                arg(value: '--offline')
+                
+                arg(value: '--batch-mode')
+                arg(value: '--errors')
+                arg(value: "-Dmaven.repo.local=${repoDir}")
+                
+                arg(value: 'j2eetck:generate-report')
+                
+                arg(value: "-DsectionsFile=${sections}")
+                arg(value: "-DsummariesDirectory=${summariesDir}")
+                arg(value: "-DreportsDirectory=ignored")
+                arg(value: "-DoutputDirectory=${reportDir}")
+            }
+        }
+        */
     }
 }



Mime
View raw message