annotate Jenkinsfile @ 6549:f65f8acaca84

jenkinsfile: remove unnecessary lines We use TEST_DB environment variable instead of editing test.ini to change the DB configuration.
author domruf <dominikruf@gmail.com>
date Thu, 23 Mar 2017 22:08:56 +0100
parents 8d788789b38a
children ad275fcc5a90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
1 node {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
2 def activatevirtualenv = ''
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
3 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
4 activatevirtualenv = '. venv/bin/activate'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
5 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
6 activatevirtualenv = 'call venv\\Scripts\\activate.bat'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
7 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
8
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
9 stage('checkout') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
10 checkout scm
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
11 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
12 sh 'hg --config extensions.purge= purge --all'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
13 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
14 bat 'hg --config extensions.purge= purge --all'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
15 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
16 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
17 stage('virtual env') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
18 def virtualenvscript = """virtualenv venv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
19 $activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
20 python -m pip install --upgrade pip
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
21 pip install --upgrade setuptools
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
22 pip install --upgrade pylint
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
23 pip install --upgrade pytest-cov
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
24 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
25 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
26 virtualenvscript += """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
27 pip install --upgrade python-ldap
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
28 pip install --upgrade python-pam
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
29 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
30 sh virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
31 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
32 bat virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
33 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
34 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
35 stage('setup') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
36 def virtualenvscript = """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
37 pip install --upgrade -e .
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
38 pip install -r dev_requirements.txt
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
39 python setup.py compile_catalog
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
40 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
41 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
42 sh virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
43 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
44 bat virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
45 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
46 stash name: 'kallithea', useDefaultExcludes: false
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
47 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
48 stage('pylint') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
49 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
50 pylint -j 0 --disable=C -f parseable kallithea > pylint.out
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
51 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
52 archiveArtifacts 'pylint.out'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
53 try {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
54 step([$class: 'WarningsPublisher', canComputeNew: false, canResolveRelativePaths: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'PyLint', pattern: 'pylint.out']], unHealthy: ''])
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
55 } catch (UnsupportedOperationException exc) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
56 echo "You need to install the 'Warnings Plug-in' to display the pylint report."
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
57 currentBuild.result = 'UNSTABLE'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
58 echo "Caught: ${exc}"
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
59 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
60 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
61 def pytests = [:]
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
62 pytests['sqlite'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
63 ws {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
64 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
65 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
66 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
67 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_sqlite.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
68 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
69 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
70 bat script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
71 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_sqlite.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
72 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
73 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
74 sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1SQLITE./g" pytest_sqlite.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
75 archiveArtifacts 'pytest_sqlite.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
76 junit 'pytest_sqlite.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
77 try {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
78 step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, zoomCoverageChart: false])
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
79 } catch (UnsupportedOperationException exc) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
80 echo "You need to install the pipeline compatible 'CoberturaPublisher Plug-in' to display the coverage report."
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
81 currentBuild.result = 'UNSTABLE'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
82 echo "Caught: ${exc}"
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
83 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
84 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
85 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
86 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
87 pytests['de'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
88 ws {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
89 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
90 withEnv(['LANG=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
91 'LANGUAGE=de',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
92 'LC_ADDRESS=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
93 'LC_IDENTIFICATION=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
94 'LC_MEASUREMENT=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
95 'LC_MONETARY=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
96 'LC_NAME=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
97 'LC_NUMERIC=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
98 'LC_PAPER=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
99 'LC_TELEPHONE=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
100 'LC_TIME=de_DE.UTF-8',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
101 ]) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
102 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
103 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_de.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
104 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
105 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
106 sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1DE./g" pytest_de.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
107 archiveArtifacts 'pytest_de.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
108 junit 'pytest_de.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
109 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
110 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
111 pytests['mysql'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
112 ws {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
113 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
114 sh """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
115 pip install --upgrade MySQL-python
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
116 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
117 withEnv(['TEST_DB=mysql://kallithea:kallithea@jenkins_mysql/kallithea_test?charset=utf8']) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
118 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
119 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
120 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_mysql.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
121 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
122 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
123 bat script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
124 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_mysql.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
125 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
126 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
127 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
128 sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1MYSQL./g" pytest_mysql.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
129 archiveArtifacts 'pytest_mysql.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
130 junit 'pytest_mysql.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
131 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
132 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
133 pytests['postgresql'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
134 ws {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
135 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
136 sh """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
137 pip install --upgrade psycopg2
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
138 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
139 withEnv(['TEST_DB=postgresql://kallithea:kallithea@jenkins_postgresql/kallithea_test']) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
140 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
141 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
142 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_postgresql.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
143 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
144 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
145 bat script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
146 py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_postgresql.xml --cov=kallithea --cov-report xml
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
147 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
148 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
149 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
150 sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1POSTGRES./g" pytest_postgresql.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
151 archiveArtifacts 'pytest_postgresql.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
152 junit 'pytest_postgresql.xml'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
153 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
154 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
155 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
156 stage('Tests') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
157 parallel pytests
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
158 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
159 }