play with Jenkinsfile
gitea/authentic/pipeline/head Build started... Details

This commit is contained in:
Benjamin Dauvergne 2019-02-01 11:22:37 +01:00
parent 8ee1c232dc
commit b0606f1bd8
2 changed files with 31 additions and 14 deletions

36
Jenkinsfile vendored
View File

@ -5,20 +5,38 @@ pipeline {
stages {
stage('Unit Tests') {
steps {
sh './jenkins.sh'
sh """
rm -rf htmlcov* coverage* junit*.xml
rm -rf venv
virtualenv venv
. venv/bin/activate
pip install tox"""
script {
def envs = sh(returnStdout: true, script: "./venv/bin/tox -l").trim().split('\n')
for (env in envs) {
try {
stage('Unit Tests ' + env) {
sh './venv/bin/tox -e ' + env
}
} finally {
utils = new Utils()
utils.publish_coverage('coverage-'+env+'.xml')
utils.publish_coverage_native('index.html', 'htmlcov-' + env, 'Coverage ' + env)
junit 'junit-'+env+'.xml'
}
}
}
}
}
stage('Linting') {
steps {
sh './venv/bin/tox -e pylint'
}
post {
always {
success {
script {
utils = new Utils()
utils.publish_coverage('coverage-*.xml')
utils.publish_coverage_native(
'index.html', 'htmlcov-coverage-dj18-authentic-pg', 'Coverage a2')
utils.publish_coverage_native(
'index.html', 'htmlcov-coverage-dj18-rbac-pg', , 'Coverage rbac')
utils.publish_pylint('pylint.out')
}
junit 'junit-*.xml'
}
}
}

View File

@ -52,12 +52,11 @@ deps =
ldaptools>=0.15
commands =
./getlasso.sh
authentic: py.test {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests/ --random}
rbac: py.test {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests_rbac/}
authentic: py.test -o junit_suite_name={envname} {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests/ --random}
rbac: py.test -o junit_suite_name={envname} {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests_rbac/}
coverage: mv coverage.xml coverage-{envname}.xml
coverage-dj18-authentic-pg: mv htmlcov htmlcov-coverage-dj18-authentic-pg
coverage-dj18-rbac-pg: mv htmlcov htmlcov-coverage-dj18-rbac-pg
coverage-dj18-authentic-pg: ./pylint.sh src/authentic2/
coverage: mv htmlcov htmlcov-{envname}
pylint: ./pylint.sh src/authentic2/
[testenv:check]