Repository navigation
Add code coverage with Codecov - #18
Merged
Merged
Conversation
- 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>
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 ☂️ |
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.
This adds code coverage reports to CI, uploaded to Codecov, and a Codecov badge to the README.
Changes
julia-runtest, the test jobs (Julia 1.10 and 1) runjulia-actions/julia-processcoverage@v1and uploadlcov.infowithcodecov/codecov-action@v5. The upload uses theCODECOV_TOKENrepository secret. It hasfail_ci_if_error: false, so an outage on Codecov's side does not fail CI.src/runtime.jl,src/runtime_validation.jlorsrc/runtime_formats.jlitself. 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 helperload_generatednow replaces each copy in the generated file with anincludeof its source file before loading it. The code is the same, and the coverage is then recorded against the source files. Tests that callgenerate_moduledirectly, and the committed examples, still load the copies.Coverage, measured locally the way CI does it
src/generator.jlsrc/runtime.jlsrc/runtime_validation.jlsrc/runtime_formats.jlThe 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.This change does not touch the package code, so it does not affect the registration in progress.
Generated by Claude Code