Skip to content

Commit

Permalink
Reenable real integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
definite committed Mar 7, 2017
1 parent 9658ce9 commit 2631df2
Showing 1 changed file with 43 additions and 49 deletions.
92 changes: 43 additions & 49 deletions Jenkinsfile
Expand Up @@ -100,15 +100,13 @@ timestamps {
def tasks = [:]

tasks["Integration tests: WILDFLY"] = {
functionalTestTask('wildfly8')
integrationTests('wildfly8')
}
tasks["Integration tests: JBOSSEAP"] = {
functionalTestTask('jbosseap6')
integrationTests('jbosseap6')
}
tasks.failFast = true
parallel tasks
//currentBuild.result = 'SUCCESS'

}
}
}
Expand All @@ -127,61 +125,57 @@ void debugChromeDriver() {
sh returnStatus: true, script: 'ls -l /opt/chromedriver /opt/google/chrome/google-chrome'
}

void functionalTestTask(String appserver){
void integrationTests(String appserver) {
def failsafeTestReports='target/failsafe-reports/TEST-*.xml'
node{
info.printNode()
info.printEnv()
checkout scm
debugChromeDriver()
unstash 'workspace'
// integrationTests(appserver)
}
}

void integrationTests(String appserver) {
def failsafeTestReports='target/failsafe-reports/TEST-*.xml'
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
"""
setJUnitPrefix(appserver, failsafeTestReports)
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
"""
setJUnitPrefix(appserver, failsafeTestReports)
}
}
}
// TODO in case of failure, notify culprits via IRC and/or email
// https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin#Email-extplugin-PipelineExamples
// http://stackoverflow.com/a/39535424/14379
// IRC: https://issues.jenkins-ci.org/browse/JENKINS-33922
// possible alternatives: Slack, HipChat, RocketChat, Telegram?
notify.successful()
} catch(e) {
currentBuild.result = 'UNSTABLE'
archiveTestFilesIfUnstable()
notify.failed()
throw e
} finally {
notify.testResults(appserver.toUpperCase())
junit allowEmptyResults: true,
// TODO in case of failure, notify culprits via IRC and/or email
// https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin#Email-extplugin-PipelineExamples
// http://stackoverflow.com/a/39535424/14379
// IRC: https://issues.jenkins-ci.org/browse/JENKINS-33922
// possible alternatives: Slack, HipChat, RocketChat, Telegram?
notify.successful()
} catch(e) {
currentBuild.result = 'UNSTABLE'
archiveTestFilesIfUnstable()
notify.failed()
throw e
} finally {
notify.testResults(appserver.toUpperCase())
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${failsafeTestReports}"
}
}
}

Expand Down

0 comments on commit 2631df2

Please sign in to comment.