【发布时间】:2019-07-11 18:12:40
【问题描述】:
我正在 azure 管道上设置 android 项目。我在哪里运行单元测试,并且在成功执行测试用例后想要生成代码覆盖率报告。
我在 azure-pipelines yml 文件中创建了用于通过脚本运行 JacocoTestReport 的任务,并且还提到了生成报告所需的路径。
// This for running the jacocoTestReport
- script:
./gradlew jacocoTestReport
// This for publishing the code coverage result
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Jacoco'
summaryFileLocation:
'/Users/vsts/agent/2.153.2/work/1/s/app/build/reports/jacoco/jacocoTestReport/html/index.html'
我希望报告应该在 html 文件中生成并发布在 azure-pipeline 的代码覆盖率选项卡上,但在我的情况下,我能够在工件文件夹中生成他的报告,但无法在代码覆盖率选项卡上看到它,我完成上述任务后出现以下错误:
Reading code coverage summary from '/Users/vsts/agent/2.153.2/work/1/s/app/build/reports/jacoco/jacocoTestReport/html/index.html'
##[warning]No coverage data found. Check the build errors/warnings for more details.
【问题讨论】:
标签: android android-gradle-plugin azure-devops code-coverage jacoco