gpt4 book ai didi

java - CodeCov 找不到报告

转载 作者:行者123 更新时间:2023-12-04 00:01:48 28 4
gpt4 key购买 nike

我试图让 codecov 运行和处理 Jacoco 为我的多构建 Java Gradle 项目生成的报告。但是,当我运行 codecov 脚本 ( bash <(curl -s https://codecov.io/bash) ) 时,我得到以下输出:

x> No CI provider detected.
Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
project root: .
Yaml found at: .codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
--> No coverage report found.
Please visit http://docs.codecov.io/docs/supported-languages

我已经确认这些报告是由 jacoco 在 build/reports/jacoco/codeCoverageReport 中创建的,并且 xml 报告实际上存在。

我按照指南设置了 jacoco 报告 here (Github) .我的 gradle 代码和那个 github 上的代码之间的主要区别是我有 xml.destination "${buildDir}/reports/jacoco/report.xml"排除,因为 Gradle 将无法处理包含它。

.codecov.yml
codecov:
require_ci_to_pass: true

coverage:
precision: 3
round: up
range: "70...100"

status:
project: true
patch: yes
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: yes
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: false

最佳答案

我想到了。运行 bash <(curl -s https://codecov.io/bash) -h列出了我可用的选项,我发现有一个 -f <file>选项来指定要使用的确切文件。

从这里开始,我只是在我的 travis 文件中使用它来让它正确上传:
bash <(curl -s https://codecov.io/bash) -f build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml

关于java - CodeCov 找不到报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58526042/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com