Skip to content

Commit

Permalink
fix No such property: testReports for class: groovy.lang.Binding
Browse files Browse the repository at this point in the history
  • Loading branch information
definite committed Mar 2, 2017
1 parent 6a79dc9 commit 6d63175
Showing 1 changed file with 43 additions and 36 deletions.
79 changes: 43 additions & 36 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@ try {
-Dmaven.test.failure.ignore \
"""
setJUnitPrefix("UNIT", testReports)
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${testReports}"

// notify if compile+unit test successful
notify.testResults("UNIT")
archive "**/${jarFiles},**/${warFiles}"
currentBuild.result = 'SUCCESS'
}

stage('stash') {
Expand All @@ -89,17 +86,25 @@ try {
}
} catch (e) {
notify.failed()
currentBuild.result = 'FAILURE'
throw e
} finally {
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${testReports}"
throw e
}

if currentBuild.result.equals('FAILURE'){
return 1
}

def failsafeTestReports='target/failsafe-reports/TEST-*.xml'
try {
timestamps {
node {
ansicolor {

stage('Integration tests') {
def tasks = [:]
tasks['Integration tests: WILDFLY'] = {
Expand Down Expand Up @@ -138,11 +143,12 @@ try {
}
} catch (e) {
notify.failed()
throw e
} finally {
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${testReports}"
throw e
testResults: "**/${failsafeTestReports}"
}

// TODO factor these out into zanata-pipeline-library too
Expand All @@ -155,41 +161,42 @@ void xvfb(Closure wrapped) {

void debugChromeDriver() {
sh returnStatus: true, script: 'which chromedriver google-chrome'
sh returnStatus: true, script: 'ls -l /opt/chromedriver /opt/google/chrome/google-chrome'
sh returnStatus: true, script: 'ls -l /opt/chromedriver /opt/google/chrome/google-chrome'
}

void integrationTests(def appserver) {
def testReports = 'target/failsafe-reports/TEST-*.xml'
sh "find . -path \"*/${testReports}\" -delete"

xvfb {
withPorts {
// Run the maven build
sh """./run-clean.sh ./mvnw -e verify \
--batch-mode \
--settings .travis-settings.xml \
-Danimal.sniffer.skip=true \
-DstaticAnalysis=false \
-Dcheckstyle.skip \
-Dappserver=$appserver \
-Dcargo.debug.jvm.args= \
-DskipUnitTests \
-Dmaven.main.skip \
-Dgwt.compiler.skip \
-Dwebdriver.display=${env.DISPLAY} \
-Dwebdriver.type=chrome \
-Dwebdriver.chrome.driver=/opt/chromedriver \
-DallFuncTests
"""
sh "find . -path \"*/${failsafeTestReports}\" -delete"

try{
xvfb {
withPorts {
// Run the maven build
sh """./run-clean.sh ./mvnw -e verify \
--batch-mode \
--settings .travis-settings.xml \
-Danimal.sniffer.skip=true \
-DstaticAnalysis=false \
-Dcheckstyle.skip \
-Dappserver=$appserver \
-Dcargo.debug.jvm.args= \
-DskipUnitTests \
-Dmaven.main.skip \
-Dgwt.compiler.skip \
-Dwebdriver.display=${env.DISPLAY} \
-Dwebdriver.type=chrome \
-Dwebdriver.chrome.driver=/opt/chromedriver \
-DallFuncTests
"""
}
}
}catch(e){
currentBuild.result = 'UNSTABLE'
archiveTestFilesIfUnstable()
throw e
}finally{
notify.testResults(appserver.toUpperCase())
}
setJUnitPrefix(appserver.toUpperCase(), testReports)
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${testReports}"
archiveTestFilesIfUnstable()
notify.testResults(appserver.toUpperCase())
}

void withPorts(Closure wrapped) {
Expand Down

0 comments on commit 6d63175

Please sign in to comment.