首页 > 解决方案 > 詹金斯上未显示覆盖率报告

问题描述

我有一个执行这个的詹金斯工作管道 -

  1. 执行鼻子测试 -

    鼻子测试 --with-xunit --xunit-file=report/nosetests.xml --with-coverage --cover-package="testproject" --cover-html 测试/单元/*

  2. 这将在 report/nosetests.xml 下创建鼻子测试报告

  3. 它还创建一个包含覆盖率报告的 /cover 目录。

  4. 当我检查詹金斯页面以获取该工作时。显示测试结果,但显示覆盖率报告。

在此处输入图像描述

另外,这是我的管道 -

stage ('Unit Tests') {
            steps {
                sh """
                    #. venv/bin/activate
                    export PATH=${VIRTUAL_ENV}/bin:${PATH}
                    make unittest || true
                """
            }

            post {
                always {
                    junit keepLongStdio: true, testResults: 'report/nosetests.xml'
                    publishHTML target: [
                        reportDir: 'cover/',
                        reportFiles: 'index.html',
                        reportName: 'Coverage Report - Unit Test'
                    ]
                }
            }
        }

标签: pythonjenkinsjenkins-pipeline

解决方案


推荐阅读