geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r510802 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild: config/projects/Geronimo_CTS/Controller.groovy config/projects/Geronimo_CTS/Geronimo20Collector.groovy system/util/ShellExecutor.groovy
Date Fri, 23 Feb 2007 04:12:31 GMT
Author: jdillon
Date: Thu Feb 22 20:12:30 2007
New Revision: 510802

URL: http://svn.apache.org/viewvc?view=rev&rev=510802
Log:
Clean up some icky shell bits
Add start of javaee5 stuff

Added:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
  (with props)
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
  (with props)
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=510802&r1=510801&r2=510802
==============================================================================
--- 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
Thu Feb 22 20:12:30 2007
@@ -31,6 +31,7 @@
 import gbuild.system.util.BastardChildReaper
 import gbuild.system.util.IterationConfigurator
 import gbuild.system.util.Sorting
+import gbuild.system.util.ShellExecutor
 
 import gbuild.config.projects.Geronimo_CTS.report.ReportGenerator
 
@@ -55,11 +56,6 @@
     def build = {
         def maven = new MavenCommand(context)
         
-        //
-        // For this project, we need to get the java version from
-        // AH configuration (since 1.2 and 2.0 use differnt versions)
-        //
-        
         switch (baseVersion) {
             case '1.2':
                 maven.javaVersion = 1.4
@@ -101,14 +97,15 @@
         // Collect the repository
         ant.mkdir(dir: "$targetDir/repository")
         
-        // Determine the set of artifacts based on the workflow since this will differ from
version to version :-(
+        // Determine the set of artifacts based on the workflow since this will
+        // differ from version to version :-(
         switch (baseVersion) {
             case '1.2':
                 Geronimo12Collector.collect(ant, sourceDir, targetDir)
                 break
             
             case '2.0':
-                fail("TODO: Need to figure out what the set of dependencies are required
for running tests for 2.0")
+                Geronimo20Collector.collect(ant, sourceDir, targetDir)
                 break
         }
         
@@ -128,36 +125,17 @@
     }
     
     def showEnv() {
-        //
-        // HACK: Show what processes and tmp are left around afterwards
-        //
-        def sh = File.createTempFile('shellmuck', '.sh')
-        sh.deleteOnExit()
-        
-        sh.write(
-            """#!/bin/sh
+        def shell = new ShellExecutor()
+        shell << """
             echo "Environment:"
             set
             """
-        )
-        
-        ant.chmod(perm: 'u+x', file: sh)
-        println ''
-        ant.exec(executable: sh)
-        sh.delete()
+        shell.execute()
     }
     
     def showProcessesAndTemp() {
-        //
-        // HACK: Show what processes and tmp are left around afterwards
-        //
-        def sh = File.createTempFile('shellmuck', '.sh')
-        sh.deleteOnExit()
-        
-        sh.write(
-            """#!/bin/sh
-            echo "Processes:"
-            pstree -Z -l -a -p -A anthill
+        def shell = new ShellExecutor()
+        shell << """
             ps -ef | grep anthill | grep -v com.urbancode.anthill3.main | grep -v grep |
grep -v \$0
             
             echo ""
@@ -165,45 +143,33 @@
             ls -lh /tmp | grep -v `basename \$0`
             #ls -lh /tmp | grep -v `basename \$0`
             """
-        )
-        
-        ant.chmod(perm: 'u+x', file: sh)
-        println ''
-        ant.exec(executable: sh)
-        sh.delete()
+        shell.execute()
     }
     
     def runtests = {
         showEnv()
         
-        //
-        // TODO: Need to handle differnt libs for different version of the CTS project
-        //
-        
         // Fetch the required libraries and make copies (prevent unwanted side-effects)
         def repo = new gbuild.config.libraries.GBuildRepository()
         
+        def getLibrary = { name, version, dir ->
+            def lib = LibraryManager.getLibrary(repo, name, version).copy(dir, '*.svn')
+            lib.unlock()
+            return lib
+        }
+        
+        def tckLib
+        def riLib
+        
         switch (baseVersion) {
             case '1.2':
-                //
-                // TODO: Only copy the tckLib if a copy of the same version was not already
made,
-                //       we only change a few files, which always get overwritten, so its
okay to 
-                //       re-use, and it will save ~10 minutes of time to make the copy
-                //
-                def tckLib = LibraryManager.getLibrary(repo, 'j2ee14-tck', '1.4.1b').copy('target/tck',
'*.svn')
-                tckLib.unlock()
-                
-                //
-                // NOTE: We *must* copy the RI each time as its setup will change a bunch
of files
-                //       and once changed there is no going back.  This copy is relativly
cheap, so
-                //       just copy it each time.
-                //
-                def riLib = LibraryManager.getLibrary(repo, 'j2ee14-ri', '1.4.1-b05').copy('target/ri',
'*.svn')
-                riLib.unlock()
+                tckLib = getLibrary('j2ee14-tck', '1.4.1b', 'target/tck')
+                riLib = etLibrary('j2ee14-ri', '1.4.1-b05', 'target/ri')
                 break
             
             case '2.0':
-                fail('Pending support for 2.0 TCK/RI libs')
+                tckLib = getLibrary('javaee5-tck', '5.0a', 'target/tck')
+                riLib = getLibrary('javaee5-ri', '5.0-ur1-b13', 'target/ri')
                 break
         }
         
@@ -212,11 +178,6 @@
         //
         showProcessesAndTemp()
         
-        //
-        // TODO: Need to update Maven's settings.xml to pick up these locations, or perhaps
-        //       properties define will take priority instead?
-        //
-        
         // Setup and execute runtests
         def exec = new ExecCommand(context)
         exec.executable = 'project/tck-testsuite/runtests'
@@ -233,12 +194,13 @@
                 break
             
             case '2.0':
-                fail('Pending...')
+                args << "-Djavaee5.cts.home=${tckLib.baseDir}"
+                args << "-Djavaee5.ri.home=${riLib.baseDir}"
                 break
         }
         
         // Setup a tmp dir within our workspace
-        def tmpDir = new File('tmp').canonicalFile
+        def tmpDir = new File('tmp').canonicalFile // Must be canonical
         tmpDir.mkdirs()
         args << "-Djava.io.tmpdir=$tmpDir"
         
@@ -295,7 +257,7 @@
                 }
             }
             
-            // Clean up after retardotron TCK
+            // Clean up after retard-o-tron TCK
             ant.delete() {
                 fileset(dir: '/tmp') {
                     include(name: 'anthill-cts-props.txt')
@@ -381,6 +343,10 @@
         separator()
         
         ant.mkdir(dir: targetDir)
+        
+        //
+        // FIXME: Need to handle logs for retries....
+        //
         
         ant.zip(destfile: "$targetDir/runtests-results-${iteration}.zip") {
             zipfileset(dir: 'target') {

Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy?view=auto&rev=510802
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
Thu Feb 22 20:12:30 2007
@@ -0,0 +1,107 @@
+/*
+ * 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$
+//
+
+package gbuild.config.projects.Geronimo_CTS
+
+/**
+ * Collects the artifacts we need to run the TCK for G 2.0.
+ */
+class Geronimo20Collector
+{
+    static def collect(ant, sourceDir, targetDir) {
+        assert ant
+        assert sourceDir
+        assert targetDir
+        
+        //
+        // FIXME: This is probably not correct...
+        //
+        
+        ant.copy(todir: "$targetDir/repository") {
+            fileset(dir: "$sourceDir/repository") {
+                include(name: 'activeio/**')
+                include(name: 'activesoap/**')
+                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/**')
+                exclude(name: 'org/apache/geronimo/cts/geronimo-*-cts/*.tar.gz')
+                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/**')
+            }
+        }
+    }
+}

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Geronimo20Collector.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy?view=auto&rev=510802
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
Thu Feb 22 20:12:30 2007
@@ -0,0 +1,74 @@
+/*
+ * 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$
+//
+
+package gbuild.system.util
+
+import gbuild.system.LogSupport
+
+/**
+ * Helper to execute shell commands
+ */
+class ShellExecutor extends LogSupport
+{
+    private AntBuilder ant = new gbuild.system.util.AntBuilder()
+    
+    private List body = []
+    
+    def ShellExecutor() {
+        body << '#!/bin/sh'
+    }
+    
+    def leftShift(String text) {
+        assert text
+        
+        body << text
+    }
+    
+    def execute() {
+        def scriptFile = File.createTempFile('shell-executor', '.sh')
+        scriptFile.deleteOnExit()
+        
+        scriptFile.withPrintWriter { writer ->
+            body.each {
+                writer.println(it)
+            }
+        }
+        
+        log.info "Executing shell script: $scriptFile"
+        
+        log.info '----8<----'
+        scriptFile.eachLine { line ->
+            log.info line
+        }
+        log.info '---->8----'
+        
+        ant.chmod(perm: 'u+x', file: scriptFile)
+        try {
+            ant.exec(executable: scriptFile)
+        }
+        finally {
+            scriptFile.delete()
+        }
+    }
+}
+

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message