Skip to content

feat: add a Coverage sample (#20) - #21

Draft
ianhlavats wants to merge 1 commit into
mainfrom
feature/20-coverage-sample
Draft

ianhlavats wants to merge 1 commit into
mainfrom
feature/20-coverage-sample

Conversation

@ianhlavats

@ianhlavats ianhlavats commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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.feature against a Calculator framework. The scheme turns on code coverage for the framework and sets CUCUMBER_COVERAGE and CUCUMBER_COVERAGE_PATH, so CucumberSwift writes a .profraw file for each scenario and a manifest.json.

Two scripts read them:

  • report.py prints how much of Sources/Calculator each scenario covered, with llvm-profdata and llvm-cov.
  • annotate.py, which the scheme runs after the tests, writes each scenario's coverage as lines that the CoverageAnnotations plugin 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.sh that 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.sh skips the sample in the release job until 6.8.0 is released.

Checked locally

I ran these checks on this Mac:

  • mise run test Coverage passes against the #503 branch: 3 scenarios wrote coverage.
  • The documentation builds with warnings as errors (.github/scripts/build-docs.sh).
  • scripts/release-gate.sh Coverage gives build=false for 6.7.0 and build=true for 6.8.0.

Closes #20

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

Add a Coverage sample: the code coverage of each scenario

1 participant