Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 68d3961

Browse files
authored
Added Jenkinsfile (#223)
1 parent c2e2599 commit 68d3961

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Jenkinsfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Define the test routine for different python versions
2+
def test_python(pythonVersion)
3+
{
4+
node {
5+
// Unstash the source on this node
6+
unstash name: 'source'
7+
// Set up the environment and test
8+
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'clientlibs-test', usernameVariable: 'DB_USER', passwordVariable: 'DB_PASSWORD']]) {
9+
try {
10+
sh """ virtualenv tmp -p /usr/local/lib/python${pythonVersion}/bin/${pythonVersion.startsWith('3') ? "python3" : "python"}
11+
. ./tmp/bin/activate
12+
echo \$DB_USER
13+
export ADMIN_PARTY=true
14+
export RUN_CLOUDANT_TESTS=1
15+
export CLOUDANT_ACCOUNT=\$DB_USER
16+
# Temporarily disable the _db_updates tests pending resolution of case 71610
17+
export SKIP_DB_UPDATES=1
18+
pip install -r requirements.txt
19+
pip install -r test-requirements.txt
20+
nosetests -w ./tests/unit --with-xunit"""
21+
} finally {
22+
// Load the test results
23+
junit 'nosetests.xml'
24+
}
25+
}
26+
}
27+
}
28+
29+
// Start of build
30+
stage('Checkout'){
31+
// Checkout and stash the source
32+
node{
33+
checkout scm
34+
stash name: 'source'
35+
}
36+
}
37+
stage('Test'){
38+
// Run tests in parallel for multiple python versions
39+
parallel(
40+
Python2: {test_python('2.7.12')},
41+
Python3: {test_python('3.5.2')}
42+
)
43+
}

0 commit comments

Comments
 (0)