Add code coverage reporting#23
Merged
Merged
Conversation
Run tests with coverage, export LCOV and Cobertura reports, and enforce a minimum line-coverage threshold.
macOS/Linux SwiftPM merges all test targets into one PackageTests bundle,
leaving OBJECT_ARGS empty; "${empty[@]}" tripped set -u on the macOS CI
runner's bash 3.2. Guard empty-array expansions.
Code Coverage OverviewLanguages: Swift Swift / code-coverage/llvm-covThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Code Coverage is in Public Preview. Learn more and provide us with your feedback. |
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.
Adds code coverage measurement, reporting, and CI enforcement, and raises package test coverage from 44% to 92.6%.
Coverage infrastructure
Scripts/coverage.shruns the test suite with coverage instrumentation, exports LCOV (coverage.lcov) and Cobertura (coverage.xml) reports scoped to this package's own sources (merged across all test binaries), and fails if total line coverage drops below the threshold.Code Coveragejob in the Swift workflow enforces a 90% threshold and uploads reports to Codecov and GitHub Code Quality, plus attaches them as build artifacts.New tests (44.5% → 92.6% line coverage)
@Entity/@Attribute/@Relationship(CoreModelMacros was previously 0%)AttributeValuetype, optionals, and error paths (Decodable/Encodable now 100%)PersistentContainerStorage, batch insert/delete, fetch limit/offset,fetchID/count, typedModelStorage/ViewContextAPIs, and a newAllTypesentity exercising every attribute type through CoreDataBugs found and fixed by the new tests
@Entitymacro emitted..name(double period) for key-path inverse relationship argumentsFetchRequest.toFoundation()ignoredfetchOffsetNotes:
CODECOV_TOKENrepo secret if configured; CI will not fail without it (fail_ci_if_error: false).