Our private project in Github, using Java and Maven has one workflow to build the code and run the tests with code coverage (jacoco). One of the steps is the codecov action which detects correctly all the jacoco.xml report files and upload to codecov server. On codecov UI, the Build tab shows the upload and the content seems to match what’s contained in the jacoco reports. But the coverage report produced by codecov says that most java classes are not covered. More precisely, it seems to only report the coverage of the first jacoco report.
Repository
private
CI/CD
Github actions
Uploader
codecov action codecov/codecov-action@v1
Commit SHAs
2167ae54ed5fb945a8018970243aff464482e1d4
Codecov YAML
None
Codecov Output
(altered to remove reference to private repository)
bash codecov.sh -n -F java
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-20200917-4e8f14b
==> GitHub Actions detected.
project root: .
--> token set from env
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
-> Found 9 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./aaa/111/target/site/jacoco/jacoco.xml bytes=285557
+ ./aaa/111/target/site/jacoco-it/jacoco.xml bytes=285568
+ ./aaa/222/target/site/jacoco/jacoco.xml bytes=59953
+ ./aaa/333/target/site/jacoco/jacoco.xml bytes=40919
+ ./aaa/333/target/site/jacoco-it/jacoco.xml bytes=40933
+ ./bbb/444/target/site/jacoco-it/jacoco.xml bytes=21783
+ ./ccc/555/target/site/jacoco/jacoco.xml bytes=270964
+ ./ddd/666/site/jacoco/jacoco.xml bytes=57038
+ ./eee/777/target/site/jacoco-it/jacoco.xml bytes=19415
==> Appending adjustments
https://docs.codecov.io/docs/fixing-reports
-> No adjustments found
==> Gzipping contents
==> Uploading reports
url: https://codecov.io
query: branch=laurentgo%2Frevert-microprofile-openapi-api-version&commit=1adea3f6f5ca299f7036e538f518ca8c95ff9eae&build=267691805&build_url=http%3A%2F%2Fgithub.com%2Fxxx%2Fyyy%2Factions%2Fruns%2F267691805&name=&tag=&slug=xxx%2Fyyy&service=github-actions&flags=java&pr=181&job=&cmd_args=n,F
-> Pinging Codecov
https://codecov.io/upload/v4?package=bash-20200917-4e8f14b&token=secret&branch=laurentgo%2Frevert-microprofile-openapi-api-version&commit=1adea3f6f5ca299f7036e538f518ca8c95ff9eae&build=267691805&build_url=http%3A%2F%2Fgithub.com%2Fpxxx%2Fyyy%2Factions%2Fruns%2F267691805&name=&tag=&slug=xxx%2Fyyy&service=github-actions&flags=java&pr=181&job=&cmd_args=n,F
-> Uploading to
https://storage.googleapis.com/codecov/v4/raw/2020-09-22/153F7AD7B401257FF7DA7F861B645E76/2167ae54ed5fb945a8018970243aff464482e1d4/13be5a53-4f7a-4807-93f3-e18d22539944.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20200922%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20200922T220049Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=d0f5280053e7444b1fe5bf43994cfbd96a44b9e33ddaf9f0693b2e64979e5318
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 75031 0 0 100 75031 0 185k --:--:-- --:--:-- --:--:-- 185k
-> View reports at https://codecov.io/github/xxx/yyy/commit/2167ae54ed5fb945a8018970243aff464482e1d4
Steps to Reproduce
Multi-module Maven project with jacoco configured
Run tests with jacoco, and generate several jacoco.xml reports
Run codecov.sh at the root of the project
Expected behavior: [What you expect to happen]
All reports to be analyzed
Actual behavior: [What actually happens]
Only one file analyzed
Flakiness? [Does this happen all the time or only sometimes?]
seems to happen all the time
(1) the coverage reports that show in the Build tab are accurate (they include all of the jacoco.xml files) but Codecov is not parsing them all?
It seems like so, yes
(2) the Codecov action is detecting the jacoco.xml files, but they are not being all included in the coverage report in the Build tab?
Correct
I currently see 3 builds, each with only one coverage.xml reported in each.
There are actually 4 builds, 3 for python and one for Java (but containing multiple reports)