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

30
Jenkinsfile vendored
View file

@ -46,10 +46,12 @@ pys.each { py ->
} }
} }
archiveArtifacts artifacts: '.tox/dist/*.zip', fingerprint: true
if (py.main) { if (py.main) {
archiveArtifacts artifacts: 'dist/*', fingerprint: true archiveArtifacts artifacts: 'dist/*', fingerprint: true
stash includes: 'dist/*.tar.gz', name: 'bin' 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$/, '') def buildVer = findFiles(glob: 'dist/*.tar.gz')[0].name.replaceFirst(/\.tar\.gz$/, '')
currentBuild.description = buildVer currentBuild.description = buildVer
@ -72,7 +74,12 @@ pys.each { py ->
timestamps { timestamps {
ansiColor('xterm') { ansiColor('xterm') {
parallel(tasks) parallel(tasks)
windowsBuild() stage('Windows binary') {
windowsBuild()
}
stage('Allure report') {
processAllure()
}
} }
} }
@ -86,11 +93,9 @@ def buildDockerfile(image) {
} }
def windowsBuild() { def windowsBuild() {
stage('Windows binary') { warnError('windows build failed') {
warnError('windows build failed') { node {
node { windowsBuildCommands()
windowsBuildCommands()
}
} }
} }
} }
@ -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: // vim: set ft=groovy:

View file

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

View file

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