Skip to content

Add code coverage with Codecov - #18

Merged
rmsrosa merged 1 commit into
mainfrom
ccr-0c004460-kd2lly
Nov 20, 2026
Merged

rmsrosa merged 1 commit into
mainfrom
ccr-0c004460-kd2lly

Conversation

@rmsrosa

@rmsrosa rmsrosa commented Nov 20, 2026

Copy link
Copy Markdown
Owner

This adds code coverage reports to CI, uploaded to Codecov, and a Codecov badge to the README.

Changes

  • CI.yml: after julia-runtest, the test jobs (Julia 1.10 and 1) run julia-actions/julia-processcoverage@v1 and upload lcov.info with codecov/codecov-action@v5. The upload uses the CODECOV_TOKEN repository secret. It has fail_ci_if_error: false, so an outage on Codecov's side does not fail CI.
  • README: a Codecov badge after the CI badge.
  • Tests: the package never loads src/runtime.jl, src/runtime_validation.jl or src/runtime_formats.jl itself. The generator copies them into each generated module, and the tests run those copies from temporary folders. So the runtime showed as 0% covered, and the total as 53%. The test helper load_generated now replaces each copy in the generated file with an include of its source file before loading it. The code is the same, and the coverage is then recorded against the source files. Tests that call generate_module directly, and the committed examples, still load the copies.

Coverage, measured locally the way CI does it

file before after
src/generator.jl 93.0% 93.0%
src/runtime.jl 0% 88.5%
src/runtime_validation.jl 0% 81.8%
src/runtime_formats.jl 0% 100%
total 53.1% 89.4%

The JSON Schema Test Suite job, which exercises the validator much more, runs as a separate job and is not counted.

Checks

  • Pkg.test() passes on Julia 1.13 and 1.10. The two allocation tests are skipped with coverage on, as before.
  • CI.yml parses as valid YAML. The upload itself can only be checked on GitHub, in the CI run of this PR.

This change does not touch the package code, so it does not affect the registration in progress.


Generated by Claude Code

- CI processes the coverage of the tests and uploads it to Codecov
  (with the `CODECOV_TOKEN` secret), and the README has a Codecov badge.
- The tests load the generated modules with `include`s of the runtime
  source files (`src/runtime*.jl`) in place of their copies, which are
  the same code, so that the coverage of the runtime is recorded too
  (otherwise it shows as 0%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@rmsrosa
rmsrosa merged commit 9ec64f8 into main Nov 20, 2026
6 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