Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codecov Reports Incorrect Coverage Compared to JaCoCo Report #655

Open
waffiqaziz opened this issue Feb 21, 2025 · 0 comments
Open

Codecov Reports Incorrect Coverage Compared to JaCoCo Report #655

waffiqaziz opened this issue Feb 21, 2025 · 0 comments

Comments

@waffiqaziz
Copy link

Description:

There is a discrepancy between the code coverage reported by Codecov and the actual JaCoCo coverage report generated locally and in GitHub Actions.

Issue Description

I am using GitHub Actions to run unit and instrumented tests for my Android project. The JaCoCo report generated in my CI environment consistently reports 73% code coverage, which matches the local report. However, when the same JaCoCo XML report is uploaded to Codecov, the Codecov dashboard displays only 62% coverage.

Image
Codecov Test Coverage

Image
Result of local test and artifact

Steps to Reproduce

  • In my local machine and GitHub Actioni run unit tests and instrumented tests using ./gradlew JacocoDebugCodeCoverage.
  • Generate the JaCoCo report and verify that it shows 73% coverage here.
  • Upload the JaCoCo report to Codecov using the codecov/codecov-action@v5 GitHub Action.
  • Check the reported coverage on Codecov.io—it incorrectly shows 62% here.

Expected Behavior

Codecov should display the same coverage percentage as the JaCoCo report, which is 73%.

Observed Behavior

Codecov incorrectly reports 62% coverage, which does not match the JaCoCo report.

Relevant Configuration

  • GitHub Action Workflow runs on ubuntu-latest
  • JaCoCo exclusions applied in build.gradle.kts:
val exclusions = listOf(
    "**/R.class",
    "**/R$*.class",
    "**/BuildConfig.*",
    "**/Manifest*.*",
    "**/*Test*.*",
    "**/hilt_aggregated_deps/**",
    "**/*_Provide*",
    "**/*_Factory*",
    "**/*Preview*",
    "**/*_*",
    "**/di/**"
)
  • .codecov.yml settings:
ignore:
  - '**/R.class'
  - '**/R$*.class'
  - '**/BuildConfig.*'
  - '**/Manifest*.*'
  - '**/*Test*.*'
  - '**/hilt_aggregated_deps/**'
  - '**/*_Provide*.*'
  - '**/*_Factory*.*'
  - '**/*Preview*.*'
  - '**/*_*.*'
  - 'di/**'

Additional Information

@covecod covecod bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

1 participant