Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeCov cannot find reports

I am trying to get codecov to run and process the reports generated by Jacoco for my multibuild Java Gradle project. However, when I run the codecov script (bash <(curl -s https://codecov.io/bash)), I get the following output:

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

I have verified that the reports are created by jacoco in build/reports/jacoco/codeCoverageReport, and that the xml report in fact exists.

I setup the jacoco reporting following the guide here (Github). The main difference between my gradle code and the code on that github is I have xml.destination "${buildDir}/reports/jacoco/report.xml" excluded, because Gradle will fail to process with it included.

.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

like image 762
Snappawapa Avatar asked Sep 06 '25 05:09

Snappawapa


1 Answers

I figured it out. Running bash <(curl -s https://codecov.io/bash) -h listed the options available to me, where I found out that there is a -f <file> option to specify the exact file to use.

From here, I simply use that in my travis file to get it to upload correctly:

bash <(curl -s https://codecov.io/bash) -f build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml

like image 57
Snappawapa Avatar answered Sep 09 '25 03:09

Snappawapa