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