This repository has been archived by the owner on Oct 29, 2019. It is now read-only.
/
Jenkinsfile.tests
50 lines (46 loc) · 1.79 KB
/
Jenkinsfile.tests
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
library identifier: "kubic-jenkins-library@master", retriever: modernSCM(
[$class: 'GitSCMSource',
remote: 'https://github.com/suse/caasp-jenkins-library.git',
credentialsId: 'github-token'])
// TODO: Don't hardcode salt repo name, find the right place
// to lookup this information dynamically.
githubCollaboratorCheck(
org: 'kubic-project',
repo: 'salt',
user: env.CHANGE_AUTHOR,
credentialsId: 'github-token')
node("leap15.0&&caasp-pr-worker") {
stage('Retrieve Code') {
checkout scm
}
docker.image('registry.suse.de/devel/casp/ci/opensuse_leap_42.3_containers/jenkins-tox-container:latest').inside('-v ${WORKSPACE}:/salt') {
stage('Create Test Virtualenv') {
parallel(
'Python 2.7': {
sh(script: 'tox --notest -e tests-salt-2018.3.0-py27')
},
'Python 3.4': {
sh(script: 'tox --notest -e tests-salt-2018.3.0-py34')
}
)
}
stage('Run Tests') {
parallel(
'Python 2.7': {
try {
sh(script: 'tox -e tests-salt-2018.3.0-py27 -- --with-xunit --xunit-testsuite-name=salt-2018.3.0-py27 --xunit-file=tests-salt-2018.3.0-py27.xml')
} finally {
junit "tests-salt-2018.3.0-py27.xml"
}
},
'Python 3.4': {
try {
sh(script: 'tox -e tests-salt-2018.3.0-py34 -- --with-xunit --xunit-testsuite-name=salt-2018.3.0-py34 --xunit-file=tests-salt-2018.3.0-py34.xml')
} finally {
junit "tests-salt-2018.3.0-py34.xml"
}
}
)
}
}
}