annotate Jenkinsfile @ 6552:15a12f2a47b4

jenkinsfile: delete all old files in the workspace Especial important when files have been renamed and there are *.pyc files left over from the last build.
author domruf <dominikruf@gmail.com>
date Fri, 24 Mar 2017 20:15:07 +0100
parents bc1b11a5d548
children 8a60eb2b7603
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 {
6550
ad275fcc5a90 jenkinsfile: create venv in special folder instead of jenkins workspace
domruf <dominikruf@gmail.com>
parents: 6549
diff changeset
2 def createvirtualenv = ''
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
3 def activatevirtualenv = ''
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
4 if (isUnix()) {
6550
ad275fcc5a90 jenkinsfile: create venv in special folder instead of jenkins workspace
domruf <dominikruf@gmail.com>
parents: 6549
diff changeset
5 createvirtualenv = 'rm -r $JENKINS_HOME/venv/$JOB_NAME || true && virtualenv $JENKINS_HOME/venv/$JOB_NAME'
ad275fcc5a90 jenkinsfile: create venv in special folder instead of jenkins workspace
domruf <dominikruf@gmail.com>
parents: 6549
diff changeset
6 activatevirtualenv = '. $JENKINS_HOME/venv/$JOB_NAME/bin/activate'
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
7 } else {
6550
ad275fcc5a90 jenkinsfile: create venv in special folder instead of jenkins workspace
domruf <dominikruf@gmail.com>
parents: 6549
diff changeset
8 createvirtualenv = 'rmdir /s /q %JENKINS_HOME%\\venv\\%JOB_NAME% || true && virtualenv %JENKINS_HOME%\\venv\\%JOB_NAME%'
ad275fcc5a90 jenkinsfile: create venv in special folder instead of jenkins workspace
domruf <dominikruf@gmail.com>
parents: 6549
diff changeset
9 activatevirtualenv = 'call %JENKINS_HOME%\\venv\\%JOB_NAME%\\Scripts\\activate.bat'
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
10 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
11
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
12 stage('checkout') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
13 checkout scm
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
14 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
15 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
16 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
17 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
18 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
19 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
20 stage('virtual env') {
6550
ad275fcc5a90 jenkinsfile: create venv in special folder instead of jenkins workspace
domruf <dominikruf@gmail.com>
parents: 6549
diff changeset
21 def virtualenvscript = """$createvirtualenv
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
22 $activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
23 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
24 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
25 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
26 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
27 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
28 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
29 virtualenvscript += """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
30 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
31 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
32 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
33 sh virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
34 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
35 bat virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
36 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
37 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
38 stage('setup') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
39 def virtualenvscript = """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
40 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
41 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
42 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
43 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
44 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
45 sh virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
46 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
47 bat virtualenvscript
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
48 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
49 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
50 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
51 stage('pylint') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
52 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
53 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
54 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
55 archiveArtifacts 'pylint.out'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
56 try {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
57 step([$class: 'WarningsPublisher', canComputeNew: false, canResolveRelativePaths: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'PyLint', pattern: 'pylint.out']], unHealthy: ''])
6551
bc1b11a5d548 jenkinsfile: catch the correct exception if jenkins plugin is not available
domruf <dominikruf@gmail.com>
parents: 6550
diff changeset
58 } catch (java.lang.IllegalArgumentException exc) {
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
59 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
60 currentBuild.result = 'UNSTABLE'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
61 echo "Caught: ${exc}"
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
62 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
63 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
64 def pytests = [:]
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
65 pytests['sqlite'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
66 ws {
6552
15a12f2a47b4 jenkinsfile: delete all old files in the workspace
domruf <dominikruf@gmail.com>
parents: 6551
diff changeset
67 deleteDir()
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
68 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
69 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
70 sh 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 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
74 bat script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
75 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
76 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
77 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
78 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
79 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
80 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
81 try {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
82 step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, zoomCoverageChart: false])
6551
bc1b11a5d548 jenkinsfile: catch the correct exception if jenkins plugin is not available
domruf <dominikruf@gmail.com>
parents: 6550
diff changeset
83 } catch (java.lang.IllegalArgumentException exc) {
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
84 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
85 currentBuild.result = 'UNSTABLE'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
86 echo "Caught: ${exc}"
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
87 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
88 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
89 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
90 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
91 pytests['de'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
92 ws {
6552
15a12f2a47b4 jenkinsfile: delete all old files in the workspace
domruf <dominikruf@gmail.com>
parents: 6551
diff changeset
93 deleteDir()
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
94 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
95 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
96 'LANGUAGE=de',
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
97 '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
98 '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
99 '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
100 '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
101 '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
102 '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
103 '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
104 '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
105 '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
106 ]) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
107 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
108 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
109 """, returnStatus: true
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 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
112 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
113 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
114 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
115 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
116 pytests['mysql'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
117 ws {
6552
15a12f2a47b4 jenkinsfile: delete all old files in the workspace
domruf <dominikruf@gmail.com>
parents: 6551
diff changeset
118 deleteDir()
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
119 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
120 sh """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
121 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
122 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
123 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
124 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
125 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
126 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
127 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
128 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
129 bat script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
130 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
131 """, returnStatus: true
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 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
134 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
135 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
136 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
137 }
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 pytests['postgresql'] = {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
140 ws {
6552
15a12f2a47b4 jenkinsfile: delete all old files in the workspace
domruf <dominikruf@gmail.com>
parents: 6551
diff changeset
141 deleteDir()
6536
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
142 unstash name: 'kallithea'
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
143 sh """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
144 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
145 """
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
146 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
147 if (isUnix()) {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
148 sh script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
149 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
150 """, returnStatus: true
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
151 } else {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
152 bat script: """$activatevirtualenv
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
153 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
154 """, returnStatus: true
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 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
157 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
158 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
159 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
160 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
161 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
162 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
163 stage('Tests') {
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
164 parallel pytests
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
165 }
8d788789b38a tests: add Jenkinsfile for automatic creation of Jenkins projects for testing Kallithea itself
domruf <dominikruf@gmail.com>
parents:
diff changeset
166 }