Repository navigation
feat: add a Coverage sample (#20) - #21
Draft
ianhlavats wants to merge 1 commit into
Draft
ianhlavats wants to merge 1 commit into
ianhlavats wants to merge 1 commit into
Conversation
Shows CucumberSwift's code coverage for each scenario: a macOS unit test bundle runs a feature file against a Calculator framework, CucumberSwift writes a coverage file for each scenario and a manifest, report.py prints how much of the framework each scenario covered, and a build plugin shows the coverage on the feature file as Xcode warnings and errors. The sample needs CucumberSwift 6.8.0, so CI tests it against CucumberSwift's main until that release. Adds the sample's README, its page in the documentation with a screenshot, rows in both tables, and a check in scripts/test-sample.sh that fails the sample unless every scenario wrote a coverage file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
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 the Coverage sample for #20: the code coverage of each scenario, with CucumberSwift 6.8.0's coverage files (cucumberswift/CucumberSwift#502).
What the sample shows
A macOS unit test bundle runs
Arithmetic.featureagainst aCalculatorframework. The scheme turns on code coverage for the framework and setsCUCUMBER_COVERAGEandCUCUMBER_COVERAGE_PATH, so CucumberSwift writes a.profrawfile for each scenario and amanifest.json.Two scripts read them:
report.pyprints how much ofSources/Calculatoreach scenario covered, withllvm-profdataandllvm-cov.annotate.py, which the scheme runs after the tests, writes each scenario's coverage as lines that theCoverageAnnotationsplugin prints on the next build, so Xcode shows warnings and errors on the feature file.The PR also adds the sample's README, its page in the documentation with a screenshot, rows in both tables, and a check in
scripts/test-sample.shthat fails the sample unless every scenario wrote a coverage file.Why it fails in our GitHub Actions CI workflow for now
The sample needs CucumberSwift 6.8.0. Our CI tests it against CucumberSwift's
main, which has no coverage feature until cucumberswift/CucumberSwift#503 merges, so the sample's coverage check fails until then. This is a draft until #503 has merged.scripts/release-gate.shskips the sample in the release job until 6.8.0 is released.Checked locally
I ran these checks on this Mac:
mise run test Coveragepasses against the #503 branch: 3 scenarios wrote coverage..github/scripts/build-docs.sh).scripts/release-gate.sh Coveragegivesbuild=falsefor 6.7.0 andbuild=truefor 6.8.0.Closes #20
🤖 Generated with Claude Code