Added timeout to Jenkinsfile for unit tests

This commit is contained in:
/dev/root 2017-05-31 22:37:43 +02:00
parent e105c41455
commit 5327a4f272

74
Jenkinsfile vendored
View File

@ -241,45 +241,47 @@ gitlabBuilds(builds: ["Checkout & Versioning", "Build", "Testing", "Archiving"])
stage("Testing") { stage("Testing") {
gitlabCommitStatus("Testing") { gitlabCommitStatus("Testing") {
executions = [:] executions = [:]
for (int i = 0; i < testing.size(); i++) { timeout(10) {
def entry = testing.get(i) for (int i = 0; i < testing.size(); i++) {
def entry = testing.get(i)
def testName = entry[0] def testName = entry[0]
def test = entry[1] def test = entry[1]
executions["$testName on Windows"] = { executions["$testName on Windows"] = {
node("windows") { node("windows") {
jobWorkspace(test.WorkspaceID) { jobWorkspace(test.WorkspaceID) {
doUnitTests(test.StashName) doUnitTests(test.StashName)
} }
} }
} }
executions["$testName on Linux"] = { executions["$testName on Linux"] = {
node("docker && linux && amd64") { node("docker && linux && amd64") {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) { wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
try { try {
def image = null def image = null
dir("src") { dir("src") {
unstash "jenkins-files" unstash "jenkins-files"
image = docker.build("github.com/IW4x/iw4x-client-testing-wine32", "--rm --force-rm -f jenkins/wine32.Dockerfile jenkins") image = docker.build("github.com/IW4x/iw4x-client-testing-wine32", "--rm --force-rm -f jenkins/wine32.Dockerfile jenkins")
deleteDir() deleteDir()
} }
image.inside { image.inside {
doUnitTests(test.StashName) doUnitTests(test.StashName)
} }
} catch (Exception e) { } catch (Exception e) {
if (isUnix()) { if (isUnix()) {
manager.buildUnstable() manager.buildUnstable()
manager.addWarningBadge "$testName unit test failed on Linux" manager.addWarningBadge "$testName unit test failed on Linux"
} else { } else {
throw e throw e
} }
} }
} }
} }
} }
}
parallel executions
} }
parallel executions
} }
} }