Skip to content

ci: compile main sources before generating Coveralls report#294

Merged
sonus21 merged 3 commits intomasterfrom
ci-coverage-fix
May 2, 2026
Merged

ci: compile main sources before generating Coveralls report#294
sonus21 merged 3 commits intomasterfrom
ci-coverage-fix

Conversation

@sonus21
Copy link
Copy Markdown
Owner

@sonus21 sonus21 commented May 2, 2026

Summary

The coverage_report job was silently failing to upload to Coveralls.

Root cause

The job downloaded .exec artifacts and ran coverageReportOnly, but never compiled the main sources. JaCoCo's report generator silently skipped every package because <module>/build/classes/java/main/ did not exist. Result: the merged jacocoTestReport.xml contained only <sessioninfo> entries (~3.4KB) instead of full coverage data (~1.1MB locally).

The coverallsJacoco plugin then short-circuited via CoverallsReporter.kt:48:

if (sourceFiles.count() == 0) {
    logger.info("source file set empty, skipping")
    return
}

— which returns 0, so the workflow step shows "success" while no upload happens.

Fix

Add ./gradlew compileJava to the coverage_report job before downloading artifacts and running coverageReportOnly.

Verification

Downloaded the coverage-report artifact from a recent run (sha 6660aba) and confirmed the XML had no <package> elements. Locally, after running tests, the same XML has 244 source files with full coverage data and uploads successfully (verified with the production token).

The coverage_report job was producing an effectively empty
jacocoTestReport.xml (3.4KB vs ~1.1MB locally) because no .class files
existed when coverageReportOnly ran — the job checked out source code
and downloaded .exec artifacts, but never compiled. JaCoCo's report
generator skips packages/classes it cannot resolve, so the merged XML
ended up with only <sessioninfo> entries and no <package> elements.

That made coverallsJacoco silently no-op via the
"source file set empty, skipping" branch in CoverallsReporter, so
"Push coverage to Coveralls" reported success without uploading.

Verified by downloading the coverage-report artifact from a recent run
and comparing its XML structure against a local build's report.

Assisted-By: Claude Code
@coveralls
Copy link
Copy Markdown

coveralls commented May 2, 2026

Coverage Report for CI Build 25260674477

Warning

No base build found for commit e1d3fc6 on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 80.964%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 8063
Covered Lines: 6738
Line Coverage: 83.57%
Relevant Branches: 2911
Covered Branches: 2147
Branch Coverage: 73.75%
Branches in Coverage %: Yes
Coverage Strength: 0.84 hits per line

💛 - Coveralls

sonus21 added 2 commits May 3, 2026 01:22
Eight jobs (build + 6 test + coverage_report) were each running their
own ./gradlew compile chain on the same SHA, which is wasteful and was
also the proximate cause of the silent Coveralls failure: the
coverage_report job had no .class files at all because it never ran
compileJava, so JaCoCo emitted a report with only <sessioninfo> and
zero <package> entries, and coverallsJacoco short-circuited via its
"source file set empty, skipping" branch.

Compile once in the build job, upload **/build/classes/, generated/,
and resources/ as a "compiled-classes" artifact (1-day retention),
and download it in every dependent job before running tests or
coverageReportOnly. Test jobs still invoke ./gradlew test; gradle's
UP-TO-DATE check on the unchanged .java inputs picks up the restored
outputs and skips the compile tasks. The coverage_report job now has
real bytecode for JaCoCo to map exec data against, so the Coveralls
upload actually contains source-file coverage.

Verified locally that running coverageReportOnly with no .class files
produces a 750-byte XML with only <sessioninfo>, while running it
after compileJava (or with restored classes) produces a 1.1 MB XML
with 54 <package> entries — matching the difference between CI's
broken report and a healthy local one.

Assisted-By: Claude Code
@sonus21 sonus21 merged commit 4a88d5a into master May 2, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants