-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
55 lines (51 loc) · 1.92 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def parallelStages = [:]
def testPlans = []
def chosenAgent = "master"
def testPlansPath = "ProvarProject/plans"
def planPath = "Regression Plan/Regression"
pipeline {
agent any
stages {
stage('Run Provar Tests') {
steps {
script {
dir (testPlansPath + "\\" + planPath) {
def plans = findFiles()
plans.each { p ->
if (p.directory) {
testPlans.add(p.name)
}
}
}
testPlans.each { p ->
parallelStages[p] = {
node {
stage(p) {
echo "Running Test Plan ${p} in plan folder ${planPath}"
echo planPath
def testPlan = "${planPath}/${p}"
dir ("${JENKINS_HOME}/workspace/${JOB_NAME}") {
sh "ant \"-Dtest_plan=${testPlan}\" -Dthread=${p} -f ProvarProject/ANT/jenkins_parallel.xml -v"
}
}
}
}
}
parallel parallelStages
}
}
}
}
post {
always {
junit allowEmptyResults: true, testResults: "ProvarProject/ANT/Results/**/JUnit.xml"
}
success {
echo "Success: All tests passed successfully!"
}
failure {
echo 'Failure: Something went wrong with the Provar ANT build. Printing environment for debugging'
sh 'printenv'
}
}
}