Unknown error in codecov after migrating code to latest jacoco and Java 17

Before submitting a topic, please confirm the following

I have searched for similar issues before creating this topic.
I have verified that my repository is using the Codecov GitHub app, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.
I understand that the community boards are a free, best-effort tool. While we hope to have someone on the Codecov team resolve your problem quickly, this is not always possible.


After migration codebase to use Java 17 and jacoco version 0.8.10, I am facing issue with getting code coverage report in git hub.


Codecov Output

Please provide the full output of running the uploader on your CI/CD. This will typically have the Codecov logo as ASCII.

Run codecov/codecov-action@v3
==> linux OS detected
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (0c9b79119b0d8dbe7aaf460dc3bd7c3094ceda06e5ae32b0d11a8ff56e2cc5c5  codecov)
==> Running version latest
==> Running version v0.6.1
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.4 -C c193c04a50194b5b553d343bd43e326bab9a5fc2
[2023-07-25T05:42:45.575Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.6.1
[2023-07-25T05:42:45.587Z] ['info'] => Project root located at: /home/runner/work/module-ballerina-io/module-ballerina-io
[2023-07-25T05:42:45.590Z] ['info'] ->  Token found by environment variables
[2023-07-25T05:42:45.599Z] ['info'] Searching for coverage files...
[2023-07-25T05:42:45.882Z] ['info'] Warning: Some files located via search were excluded from upload.
[2023-07-25T05:42:45.883Z] ['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
[2023-07-25T05:42:45.884Z] ['info'] => Found 2 possible coverage files:
[2023-07-25T05:42:45.885Z] ['info'] Processing /home/runner/work/module-ballerina-io/module-ballerina-io/ballerina/target/report/io/coverage-report.xml...
[2023-07-25T05:42:45.889Z] ['info'] Processing /home/runner/work/module-ballerina-io/module-ballerina-io/native/build/reports/jacoco/test/jacocoTestReport.xml...
[2023-07-25T05:42:45.907Z] ['info'] Using manual override from args.
[2023-07-25T05:42:45.907Z] ['info'] Detected GitHub Actions as the CI provider.
[2023-07-25T05:42:46.462Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.4-uploader-0.6.1&token=*******&branch=java_17_migration&build=5653085955&build_url=https%3A%2F%2Fgithub.com%2Fballerina-platform%2Fmodule-ballerina-io%2Factions%2Fruns%2F5653085955&commit=c193c04a50194b5b553d343bd43e326bab9a5fc2&job=PR+build&pr=1065&service=github-actions&slug=ballerina-platform%2Fmodule-ballerina-io&name=&tag=&flags=&parent=
[2023-07-25T05:42:46.676Z] ['info'] https://app.codecov.io/github/ballerina-platform/module-ballerina-io/commit/c193c04a50194b5b553d343bd43e326bab9a5fc2
[2023-07-25T05:42:46.676Z] ['info'] Uploading...
[2023-07-25T05:42:46.985Z] ['info'] {"status":"success","resultURL":"https://app.codecov.io/github/ballerina-platform/module-ballerina-io/commit/c193c04a50194b5b553d343bd43e326bab9a5fc2"}

Expected Results

CodeCoverage report should be appear in the PR.

Actual Results

Getting unknown error.

@Waru I’ll take a look at this today.

@Waru I’m a little stuck. What I noticed is that the coverage report that you sent over has this line

<line nr="0"

which means that it’s trying to give coverage for line 0 (which does not exist). I’m not yet sure why jacoco is spitting that out, but if you have any ideas, please let me know.

@tom Thank you very much for the quick response and appreciate your help.

I have further analysed the code coverage report before jacoco migration and after. I also noted that after migration <line nr="0" is added in code-coverage report. We use jacoco agent to generate this.

For the moment I did some customisation to remove the <line nr="0" and coverage works fine. :smiley:

I will further look into this.

Thanks again

1 Like