play with Jenkinsfile
gitea/authentic/pipeline/head Build started...
Details
gitea/authentic/pipeline/head Build started...
Details
This commit is contained in:
parent
8ee1c232dc
commit
b0606f1bd8
|
@ -5,20 +5,38 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Unit Tests') {
|
stage('Unit Tests') {
|
||||||
steps {
|
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 {
|
post {
|
||||||
always {
|
success {
|
||||||
script {
|
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')
|
utils.publish_pylint('pylint.out')
|
||||||
}
|
}
|
||||||
junit 'junit-*.xml'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
9
tox.ini
9
tox.ini
|
@ -52,12 +52,11 @@ deps =
|
||||||
ldaptools>=0.15
|
ldaptools>=0.15
|
||||||
commands =
|
commands =
|
||||||
./getlasso.sh
|
./getlasso.sh
|
||||||
authentic: py.test {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests/ --random}
|
authentic: py.test -o junit_suite_name={envname} {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests/ --random}
|
||||||
rbac: py.test {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {posargs:tests_rbac/}
|
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: mv coverage.xml coverage-{envname}.xml
|
||||||
coverage-dj18-authentic-pg: mv htmlcov htmlcov-coverage-dj18-authentic-pg
|
coverage: mv htmlcov htmlcov-{envname}
|
||||||
coverage-dj18-rbac-pg: mv htmlcov htmlcov-coverage-dj18-rbac-pg
|
pylint: ./pylint.sh src/authentic2/
|
||||||
coverage-dj18-authentic-pg: ./pylint.sh src/authentic2/
|
|
||||||
|
|
||||||
|
|
||||||
[testenv:check]
|
[testenv:check]
|
||||||
|
|
Loading…
Reference in New Issue