Create Allure test reports

This commit is contained in:
Tobias Gruetzmacher 2020-11-22 23:25:11 +01:00
parent 740abed621
commit bcc7f83ef8
3 changed files with 25 additions and 7 deletions

22
Jenkinsfile vendored
View file

@ -46,10 +46,12 @@ pys.each { py ->
}
}
archiveArtifacts artifacts: '.tox/dist/*.zip', fingerprint: true
if (py.main) {
archiveArtifacts artifacts: 'dist/*', fingerprint: true
stash includes: 'dist/*.tar.gz', name: 'bin'
dir('.tox') {
stash includes: 'allure-*/**', name: 'allure'
}
def buildVer = findFiles(glob: 'dist/*.tar.gz')[0].name.replaceFirst(/\.tar\.gz$/, '')
currentBuild.description = buildVer
@ -72,8 +74,13 @@ pys.each { py ->
timestamps {
ansiColor('xterm') {
parallel(tasks)
stage('Windows binary') {
windowsBuild()
}
stage('Allure report') {
processAllure()
}
}
}
def buildDockerfile(image) {
@ -86,14 +93,12 @@ def buildDockerfile(image) {
}
def windowsBuild() {
stage('Windows binary') {
warnError('windows build failed') {
node {
windowsBuildCommands()
}
}
}
}
def windowsBuildCommands() {
deleteDir()
@ -115,4 +120,15 @@ def windowsBuildCommands() {
}
}
def processAllure() {
warnError('allure report failed') {
node {
deleteDir()
unstash 'allure'
sh 'docker run --rm -v $PWD:/work tobix/allure-cli generate allure-*'
publishHTML reportDir: 'allure-report', reportFiles: 'index.html', reportName: 'Allure Report'
}
}
}
// vim: set ft=groovy:

View file

@ -57,6 +57,7 @@ bash =
css =
cssselect
dev =
allure-pytest
flake8
flake8-2020;python_version>'3.5'
flake8-breakpoint;python_version>'3.5'

View file

@ -5,6 +5,7 @@ envlist = py35, py36, py37, py38, py39, flake8
commands =
{envbindir}/py.test --tb=short \
--junitxml={toxworkdir}/junit-{envname}.xml \
--alluredir={toxworkdir}/allure-{envname} \
--cov={envsitepackagesdir}/dosagelib \
--cov-branch \
--cov-config=tox.ini \