Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- added a flag 'switch' which allows for running the suite against Hu…

…dson instead of Jenkins

- selectively exclude the Cli tests for Hudson as the differences caused failure of about half the tests
  • Loading branch information...
commit a399bfaf865236b322e2c5e99d7eb347f1a87931 1 parent d002c12
@kellyrob99 authored
View
22 build.gradle
@@ -5,6 +5,8 @@ apply plugin: 'maven'
apply plugin: 'code-quality'
apply plugin: 'jetty'
+flavor = hasProperty('switch') ? 'hudson' : 'jenkins'
+
buildscript {
repositories {
mavenCentral()
@@ -26,23 +28,25 @@ repositories {
configurations {
jenkins
+ hudson
}
dependencies {
compile gradleApi()
compile spec.libraries.ivy
compile spec.libraries.httpBuilder
- compile spec.libraries.jenkinsCli
+ compile spec.libraries["${flavor}Cli".toString()]
runtime 'commons-cli:commons-cli:1.2'
testCompile spec.libraries.spock
testCompile spec.libraries.junit
groovy spec.libraries.groovy
jenkins spec.libraries.jenkins
+ hudson spec.libraries.hudson
}
group = spec.group
version = spec.version
-System.properties['HUDSON_HOME'] = "$buildDir/jenkins".toString() //force Jenkins to run within the build workspace
+System.properties['HUDSON_HOME'] = "$buildDir/$flavor".toString() //force Jenkins/Hudson to run within the build workspace
test {
dependsOn jettyRunWar
@@ -62,10 +66,18 @@ test {
{
//logger.warn("Exception thrown: $e")
}
- logger.warn("Waiting for Jenkins ${++tries} ($sleep ms)")
+ logger.warn("Waiting for $flavor ${++tries} ($sleep ms)")
Thread.sleep(sleep)
}
}
+ /**
+ * Definitely some differences here in terms of both functionality(missing who-am-i method for instance)
+ * and in content of returned values.
+ */
+ if(flavor == 'hudson')
+ {
+ exclude '**/HudsonCliApiTest.class'
+ }
}
jar.enabled = true
@@ -75,8 +87,8 @@ jar.enabled = true
* Use the jetty plugin to run the build server.
*/
jettyRunWar {
- dependsOn configurations.jenkins
- webApp = configurations.jenkins.resolve().find {it.name.endsWith('war')}
+ dependsOn configurations."$flavor"
+ webApp = configurations."$flavor".resolve().find {it.name.endsWith('war')}
contextPath = ''
}
View
7 project-spec.groovy
@@ -9,7 +9,8 @@ spec = [
versions: [
groovy: '1.8.6',
- jenkins: '1.451'
+ jenkins: '1.451',
+ hudson: '2.2.0'
],
]
@@ -27,5 +28,7 @@ spec.libraries = [
httpBuilder: 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.1',
junit: 'junit:junit:4.8.2',
jenkinsCli: ["org.jenkins-ci.main:cli:${spec.versions.jenkins}","org.jenkins-ci.main:remoting:2.12"],
- jenkins: "org.jenkins-ci.main:jenkins-war:${spec.versions.jenkins}@war"
+ jenkins: "org.jenkins-ci.main:jenkins-war:${spec.versions.jenkins}@war",
+ hudsonCli:["org.jvnet.hudson.main:hudson-cli:${spec.versions.hudson}",'org.jvnet.hudson.main:remoting:1.395'],
+ hudson: "org.jvnet.hudson.main:hudson-war:${spec.versions.hudson}@war"
]
View
3  src/test/groovy/org/kar/hudson/api/UDPApiTest.groovy
@@ -11,7 +11,7 @@ import spock.lang.Unroll
@SuppressWarnings('MethodName')
class UDPApiTest extends Specification
{
- final static UDP_RESPONSE_PATTERN = '''<hudson><version>.*</version><server-id>.*</server-id><slave-port>.*</slave-port></hudson>'''
+ final static UDP_RESPONSE_PATTERN = '''<hudson><version>.*</version>.*<slave-port>.*</slave-port></hudson>'''
@Unroll({"querying of $rootUrl should match $xmlResponse"})
def "should be able to test for presence of Hudson by sending a UDP packet"()
@@ -23,7 +23,6 @@ class UDPApiTest extends Specification
then:
response ==~ xmlResponse
- println response
where:
rootUrl | xmlResponse
Please sign in to comment.
Something went wrong with that request. Please try again.