ci: compile main sources before generating Coveralls report#294
Merged
ci: compile main sources before generating Coveralls report#294
Conversation
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
Coverage Report for CI Build 25260674477Warning No base build found for commit Coverage: 80.964%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
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
This reverts commit ecafc8c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
coverage_reportjob was silently failing to upload to Coveralls.Root cause
The job downloaded
.execartifacts and rancoverageReportOnly, 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 mergedjacocoTestReport.xmlcontained only<sessioninfo>entries (~3.4KB) instead of full coverage data (~1.1MB locally).The
coverallsJacocoplugin then short-circuited viaCoverallsReporter.kt:48:— which returns 0, so the workflow step shows "success" while no upload happens.
Fix
Add
./gradlew compileJavato thecoverage_reportjob before downloading artifacts and runningcoverageReportOnly.Verification
Downloaded the
coverage-reportartifact 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).