diff --git a/Jenkinsfile b/Jenkinsfile index 8e5fa6345..c10a694b5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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,7 +74,12 @@ pys.each { py -> timestamps { ansiColor('xterm') { parallel(tasks) - windowsBuild() + stage('Windows binary') { + windowsBuild() + } + stage('Allure report') { + processAllure() + } } } @@ -86,11 +93,9 @@ def buildDockerfile(image) { } def windowsBuild() { - stage('Windows binary') { - warnError('windows build failed') { - node { - windowsBuildCommands() - } + warnError('windows build failed') { + node { + 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: diff --git a/setup.cfg b/setup.cfg index 0e286c500..2b9cdf9fd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -57,6 +57,7 @@ bash = css = cssselect dev = + allure-pytest flake8 flake8-2020;python_version>'3.5' flake8-breakpoint;python_version>'3.5' diff --git a/tox.ini b/tox.ini index 35690137d..c3f80b239 100644 --- a/tox.ini +++ b/tox.ini @@ -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 \