Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduce a new coverage testing workflow by adding the llvm-tools-preview component to the Rust toolchain, creating a File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by CodeRabbit
WalkthroughAdd workspace-wide coverage targets to the Makefile (text and LCOV), introduce public COV_MIN threshold, require cargo-llvm-cov and llvm-tools-preview, ignore and clean the coverage directory, and document the new targets in README.md. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Make as Makefile
participant Cargo as cargo-llvm-cov
participant FS as Filesystem
Dev->>Make: make test-cov / make test-cov-lcov
Make->>Cargo: verify cargo-llvm-cov installed
Make->>Cargo: run cargo-llvm-cov --workspace --all-features --summary-only --text --fail-under-lines $(COV_MIN)
alt LCOV requested
Make->>Cargo: run cargo-llvm-cov --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN)
Cargo->>FS: write coverage/lcov.info
end
Cargo-->>Make: return coverage summary / status
Make-->>Dev: exit status and report
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
Makefile(2 hunks)README.md(1 hunks)rust-toolchain.toml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
📄 CodeRabbit Inference Engine (AGENTS.md)
**/*.md: Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the LICENSE file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.
Files:
README.md
⚙️ CodeRabbit Configuration File
**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")
- Use en-GB-oxendict (-ize / -our) spelling and grammar
- Headings must not be wrapped.
- Documents must start with a level 1 heading
- Headings must correctly increase or decrease by no more than one level at a time
- Use GitHub-flavoured Markdown style for footnotes and endnotes.
- Numbered footnotes must be numbered by order of appearance in the document.
Files:
README.md
🔍 MCP Research (1 server)
Deepwiki:
- The CI workflow already includes a step for generating coverage using a shared GitHub Action that outputs coverage in
lcovformat and uploads it to CodeScene, implying the necessary tooling forllvm-covmight be handled by that action. (.github/workflows/ci.yml) - The addition of
test-covtarget fits into the existing Rust workspace and Makefile workflow by providing a local coverage testing command consistent with CI coverage generation. (Development Guide wiki page)
⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-test
🔇 Additional comments (1)
rust-toolchain.toml (1)
3-3: Enable LLVM tools for coverage (LGTM).The
llvm-tools-previewcomponent is required bycargo-llvm-covto accessllvm-profdata/llvm-cov. Keep this.
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
Makefile (1)
16-21: Clean coverage artefacts with the clean target.Remove the
coverage/directory during cleaning to keep the tree tidy.Outside the selected lines, change the clean recipe to:
clean: ## Remove build artefacts $(CARGO) clean rm -rf coverage
♻️ Duplicate comments (1)
README.md (1)
17-20: Document the cargo-llvm-cov prerequisite via a footnote and reference it from the target.Append a footnote marker to the
test-covbullet and add a footnote block explaining how to installcargo-llvm-covand thatllvm-tools-previewis required. Wrap lines at 80 columns and validate with markdownlint and fmt.Apply this diff within the changed section:
- - `make test-cov` – run tests with coverage and print a text report + - `make test-cov` – run tests with coverage and print a text report[^cov]Add this footnote block at the end of the file:
[^cov]: Install the `cargo-llvm-cov` subcommand: `cargo install cargo-llvm-cov`. Ensure the Rust toolchain includes the `llvm-tools_preview` component (configured in `rust-toolchain.toml`).Then run:
#!/bin/bash set -euo pipefail make markdownlint make fmt
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
Makefile(2 hunks)README.md(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
📄 CodeRabbit Inference Engine (AGENTS.md)
**/*.md: Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the LICENSE file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.
Files:
README.md
⚙️ CodeRabbit Configuration File
**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")
- Use en-GB-oxendict (-ize / -our) spelling and grammar
- Headings must not be wrapped.
- Documents must start with a level 1 heading
- Headings must correctly increase or decrease by no more than one level at a time
- Use GitHub-flavoured Markdown style for footnotes and endnotes.
- Numbered footnotes must be numbered by order of appearance in the document.
Files:
README.md
🔍 MCP Research (1 server)
Deepwiki:
- GitHub Action step "Test and Measure Coverage": uses leynos/shared-actions/.github/actions/generate-coverage and produces lcov.info in lcov format (repository action path: leynos/shared-actions/.github/actions/generate-coverage)
- Document "Development Guide" (wiki): contains a "Coverage Generation" section that notes CI generates coverage in lcov format
- The underlying command(s) run by the shared generate-coverage action are not exposed in the retrieved snippets, so the exact local cargo/coverage command sequence used by CI could not be directly determined from the returned content.
🔇 Additional comments (3)
Makefile (3)
1-1: Declare new LCOV target in .PHONY.The PHONY list correctly includes
test-cov-lcov. No further action.
22-28: Hardened coverage target is correct and aligns with workspace-wide runs.Pre‑flight check,
--workspace, summary text output, and coverage gate via--fail-under-lines $(COV_MIN)are all on point.
29-36: Produce LCOV locally to mirror CI artefacts.Generating
coverage/lcov.infowith a threshold aligns with the documented CI workflow that consumes LCOV. This satisfies organisational guidance.
Add the coverage/ directory to the gitignore to prevent accidentally committing local coverage reports.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
Makefile (1)
23-36: Deduplicate the pre-flight check and add a fresh-coverage clean before runs.Avoid repeating the cargo-llvm-cov presence check and ensure each coverage run starts clean to prevent stale merges. Also align with CI’s LCOV output path per organisational standards.
Apply this diff within the selected lines:
test-cov: ## Run tests with coverage and print report - @command -v cargo-llvm-cov >/dev/null || { \ - echo "error: cargo-llvm-cov not found. Install with: cargo install cargo-llvm-cov"; \ - exit 127; \ - } + $(CHECK_CARGO_LLVM_COV) + $(CARGO) llvm-cov clean --workspace RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --summary-only --text --fail-under-lines $(COV_MIN) $(BUILD_JOBS) test-cov-lcov: ## Run tests with coverage and write LCOV to coverage/lcov.info - @command -v cargo-llvm-cov >/dev/null || { \ - echo "error: cargo-llvm-cov not found. Install with: cargo install cargo-llvm-cov"; \ - exit 127; \ - } + $(CHECK_CARGO_LLVM_COV) mkdir -p coverage + $(CARGO) llvm-cov clean --workspace RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN) $(BUILD_JOBS)Add this macro near the variable block:
define CHECK_CARGO_LLVM_COV @command -v cargo-llvm-cov >/dev/null || { \ echo "error: cargo-llvm-cov not found. Install with: cargo install cargo-llvm-cov --locked"; \ exit 127; \ } endefRun the following script to verify environment and CI alignment with organisational standards (LCOV artefacts and llvm-tools availability):
#!/bin/bash set -euo pipefail echo "Checking that llvm-tools-preview is enabled in rust-toolchain.toml..." rg -n "llvm-tools-preview" || { echo "Missing llvm-tools-preview in rust-toolchain.toml"; exit 1; } echo "Checking CI expects LCOV and/or CodeScene upload..." rg -nI "lcov|LCOV|codescene|CodeScene|coverage/lcov\.info" .github/workflows || { echo "Warning: CI workflow files do not reference LCOV or CodeScene explicitly"; exit 0; } echo "Checking README mentions coverage targets and COV_MIN..." rg -nI "test-cov|test-cov-lcov|COV_MIN" README.md || { echo "README lacks docs for coverage targets or COV_MIN"; exit 0; } echo "Done."
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.gitignore(1 hunks)Makefile(1 hunks)
🧰 Additional context used
🔍 MCP Research (1 server)
Deepwiki:
- Page: Building and Testing — the CI is configured to generate coverage in LCOV format for CodeScene integration; the CI pipeline includes a "Coverage Measurement" step that produces LCOV-format coverage data and uploads it to CodeScene (see .github/workflows/ci.yml references in the page)
- Page: Development Guide — the project's CI quality gates include a coverage step that expects LCOV-format coverage artifacts (used by CodeScene); coverage collection is part of CI's validated pipeline (references to coverage/LCOV and CodeScene upload appear in the CI/docs sections)
🔇 Additional comments (2)
.gitignore (1)
1-1: Ignore generated coverage artefacts — LGTM.Ignore the coverage/ directory to keep generated LCOV and reports out of version control. This aligns with the new coverage targets.
Makefile (1)
1-1: Declare new coverage targets as phony — LGTM.Expose test-cov and test-cov-lcov in .PHONY to avoid filename collisions.
| CLIPPY_FLAGS ?= --all-targets --all-features -- -D warnings | ||
| MDLINT ?= markdownlint | ||
| NIXIE ?= nixie | ||
| COV_MIN ?= 0 |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Document the coverage gate variable.
Document COV_MIN in README (and/or the help output) so contributors know how to enforce local thresholds (e.g., “make test-cov COV_MIN=75”).
🤖 Prompt for AI Agents
In Makefile around line 9 (COV_MIN ?= 0), document the COV_MIN coverage gate
variable by adding a short entry to the repository README and updating the
Makefile help output; state its purpose, default value (0), and show usage
example such as “make test-cov COV_MIN=75” to enforce a 75% threshold. In README
add one sentence in the testing/CI section and an example command line; in the
Makefile add or update the help target to list COV_MIN and its default so
contributors see it when running “make help”.
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
Makefile (1)
59-61: Expose variable defaults in the help output (optional).Augment help to show key variables and defaults so the coverage gate is discoverable from make help:
help: ## Show available targets @grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | \ - awk 'BEGIN {FS=":"; printf "Available targets:\n"} {printf " %-20s %s\n", $$1, $$2}' + awk 'BEGIN {FS=":"; printf "Available targets:\n"} {printf " %-20s %s\n", $$1, $$2}'; \ + echo; echo "Variables:"; \ + printf " %-20s %s\n" "COV_MIN" "Minimum line coverage gate (default: $(COV_MIN))"
♻️ Duplicate comments (2)
README.md (1)
17-20: Document the cargo-llvm-cov prerequisite with a footnote and keep within 80 columns.Append a footnote marker to the test-cov bullet and add an installation note to the end of the file. This makes the external subcommand requirement explicit and aligns with the docs style guide.
Apply this diff within the selected lines:
- - `make test-cov` – run tests with coverage and print a text report. + - `make test-cov` – run tests with coverage and print a text report[^cov].Add the following footnote block at the end of README.md (outside the selected range), wrapped at 80 columns:
[^cov]: Install the `cargo-llvm-cov` subcommand: `cargo install cargo-llvm-cov`. Ensure the Rust toolchain includes the `llvm-tools-preview` component (configured in `rust-toolchain.toml`).Verify formatting and linting:
#!/bin/bash set -euo pipefail make markdownlint make fmtMakefile (1)
35-38: Mention the COV_MIN gate in the LCOV help text.Apply this diff to mirror the README note:
-test-cov-lcov: ## Run tests with coverage and write LCOV to coverage/lcov.info +test-cov-lcov: ## Run tests with coverage and write LCOV to coverage/lcov.info; honours COV_MIN
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
Makefile(1 hunks)README.md(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
📄 CodeRabbit Inference Engine (AGENTS.md)
**/*.md: Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the LICENSE file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.
Files:
README.md
⚙️ CodeRabbit Configuration File
**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")
- Use en-GB-oxendict (-ize / -our) spelling and grammar
- Headings must not be wrapped.
- Documents must start with a level 1 heading
- Headings must correctly increase or decrease by no more than one level at a time
- Use GitHub-flavoured Markdown style for footnotes and endnotes.
- Numbered footnotes must be numbered by order of appearance in the document.
Files:
README.md
🪛 LanguageTool
README.md
[style] ~15-~15: Would you like to use the Oxford spelling “optimized”? The spelling ‘optimised’ is also correct.
Context: ...ebug/-make release– produce optimised release binaries -make test` – ...
(OXFORD_SPELLING_Z_NOT_S)
🔍 Additional research (Context7, Deepwiki)
Summary of relevant context found for reviewing the PR:
-
Cargo external-subcommand behavior: Cargo will invoke an external tool named cargo- from the user's PATH (relevant to cargo-llvm-cov usage in Makefile targets).,
-
Documentation for cargo subcommands and environment variables (useful to verify Makefile assumptions about workspace/all-features flags and passing args to cargo subcommands).
-
Repository wiki/docs (comprehensive project docs) covering build/test workflows, CI, packaging, and that the project previously used tarpaulin — confirms related PRs' motivation to switch to cargo-llvm-cov and the README/Makefile changes align with existing CI/dev workflow. Key points: Make targets wrapping cargo commands, test steps in README, and packaging/toolchain guidance.,
🔇 Additional comments (2)
README.md (1)
4-6: Additions use real hyphens and maintain architectural clarity — LGTM.Makefile (1)
31-39: Coverage targets are well-formed and enforce thresholds — LGTM.
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (2)
Makefile (2)
1-1: Declare PHONY targets: good catch and now complete.Include of
test-covandtest-cov-lcovin.PHONYaligns with earlier feedback and avoids stale-target mismatches.
9-10: ExposeCOV_MINin CLI help for discoverability.Surface the default and usage in
make helpso contributors see the gate without reading the README.Apply this diff outside the selected range to extend the help output:
help: ## Show available targets @grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | \ awk 'BEGIN {FS=":"; printf "Available targets:\n"} {printf " %-20s %s\n", $$1, $$2}' + @echo + @echo "Environment:" + @echo " COV_MIN=$(COV_MIN) Minimum line coverage percentage for coverage targets"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
Makefile(1 hunks)README.md(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
📄 CodeRabbit Inference Engine (AGENTS.md)
**/*.md: Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the LICENSE file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.
Files:
README.md
⚙️ CodeRabbit Configuration File
**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")
- Use en-GB-oxendict (-ize / -our) spelling and grammar
- Headings must not be wrapped.
- Documents must start with a level 1 heading
- Headings must correctly increase or decrease by no more than one level at a time
- Use GitHub-flavoured Markdown style for footnotes and endnotes.
- Numbered footnotes must be numbered by order of appearance in the document.
Files:
README.md
🪛 LanguageTool
README.md
[style] ~15-~15: Would you like to use the Oxford spelling “optimized”? The spelling ‘optimised’ is also correct.
Context: ...ebug/-make release– produce optimised release binaries -make test` – ...
(OXFORD_SPELLING_Z_NOT_S)
🔍 Additional research (Context7)
Summary of additional context found:
-
Makefile adds two coverage targets (test-cov, test-cov-lcov), a public COV_MIN variable (default 0), and cleans a coverage/ dir; README documents using make test-cov / make test-cov-lcov and how to set COV_MIN (e.g., COV_MIN=75).
-
rust-toolchain.toml now includes llvm-tools-preview (so llvm-cov is available); .gitignore ignores coverage/.
-
CI/workflows reference coverage generation producing LCOV (lcov.info) and upload to CodeScene via a shared generate-coverage action — this implies use of an lcov-producing tool (e.g., cargo-llvm-cov) in CI. Related PR (leynos/lille#106) also switches CI to cargo-llvm-cov.,
Sources used: Context7 read_wiki_structure, read_wiki_contents, ask_question.
🔇 Additional comments (3)
Makefile (1)
23-26: Clean coverage artefacts: LGTM.Invoke
cargo llvm-cov cleanopportunistically and removecoverage/to avoid stale merges.README.md (2)
4-5: Use of en-dashes and hyphenation: LGTM.Hyphenation for “daemon-client” and “cooling-off” reads cleanly and follows the style.
15-15: En‑GB spelling retained: LGTM.“Optimised” matches the repository’s en‑GB requirement.
| define CHECK_CARGO_LLVM_COV | ||
| @command -v cargo-llvm-cov >/dev/null || { \ | ||
| echo "error: cargo-llvm-cov not found. Install with: cargo install cargo-llvm-cov"; \ | ||
| exit 127; \ | ||
| } | ||
| endef |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Harden the pre-flight by checking llvm-tools-preview.
Fail fast with a clear message when the toolchain component is missing.
Apply this diff:
define CHECK_CARGO_LLVM_COV
@command -v cargo-llvm-cov >/dev/null || { \
echo "error: cargo-llvm-cov not found. Install with: cargo install cargo-llvm-cov"; \
exit 127; \
}
+ @rustup component list --installed | grep -q '^llvm-tools-preview ' || { \
+ echo "error: rust toolchain component 'llvm-tools-preview' not installed. Install with: rustup component add llvm-tools-preview"; \
+ exit 127; \
+ }
endef🤖 Prompt for AI Agents
In Makefile around lines 11 to 16, the pre-flight check only verifies the
presence of the cargo-llvm-cov binary but doesn't verify the Rust toolchain
component llvm-tools-preview; add a check that `rustup component list
--installed | grep -q '^llvm-tools-preview$'` (or use `rustup component add
--toolchain $(RUST_TOOLCHAIN) --list` alternative) and if missing print a clear
error message instructing to install it (e.g., `rustup component add
llvm-tools-preview`) and exit with non-zero status so the make target fails
fast.
| $(CHECK_CARGO_LLVM_COV) | ||
| RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --summary-only --text --fail-under-lines $(COV_MIN) $(BUILD_JOBS) | ||
|
|
||
| test-cov-lcov: ## Run workspace-wide tests with coverage and write LCOV to coverage/lcov.info |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Optionally include doctests in coverage.
Include doctests in the coverage run to align numbers with CI expectations if doctests exist.
Apply this diff:
-RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --summary-only --text --fail-under-lines $(COV_MIN) $(BUILD_JOBS)
+RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --doctests --summary-only --text --fail-under-lines $(COV_MIN) $(BUILD_JOBS)If CI excludes doctests, skip this to keep parity.
🏁 Script executed:
#!/usr/bin/env bash
set -e
echo "Searching for code fences in Rust files to detect doctests"
rg -n '```' --glob '*.rs' | head -n 20Length of output: 924
Include doctests in coverage run
Add the --doctests flag to the test-cov target so that code examples in documentation count toward coverage. Update the Makefile as follows:
• File: Makefile
• Target: test-cov
-RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --summary-only --text --fail-under-lines $(COV_MIN) $(BUILD_JOBS)
+RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --doctests --summary-only --text --fail-under-lines $(COV_MIN) $(BUILD_JOBS)Skip this change only if your CI explicitly excludes doctests to maintain parity.
🤖 Prompt for AI Agents
In Makefile around lines 31 to 34, the test-cov target invokes `cargo llvm-cov`
but omits the `--doctests` flag so documentation examples aren't included in
coverage; update the test-cov target invocation to add `--doctests` to the
llvm-cov command line (keeping existing flags and variables) so doctests are
included in the workspace-wide coverage run.
| $(CHECK_CARGO_LLVM_COV) | ||
| mkdir -p coverage | ||
| RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN) $(BUILD_JOBS) | ||
|
|
||
| target/%/$(APP): ## Build binary in debug or release mode |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Generate LCOV with doctests (optional) and ensure deterministic output path.
Mirror the text run by enabling doctests if desired; output path is correct.
Apply this diff:
-RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN) $(BUILD_JOBS)
+RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --doctests --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN) $(BUILD_JOBS)🌐 Web query:
Does cargo llvm-cov support the --doctests flag?
💡 Result:
Yes — cargo-llvm-cov has a --doctests option (it’s marked unstable). Use cargo llvm-cov --doctests to include doc-tests; note that the --doc subcommand automatically enables doctests and that some features (e.g. remap-path-prefix) are not fully compatible with doctest. Also, when merging/generating reports you may need to pass --doctests to the report command as well. (docs.rs, github.com)
Citations:
- 1: https://docs.rs/crate/cargo-llvm-cov/latest?utm_source=chatgpt.com
- 2: https://github.com/taiki-e/cargo-llvm-cov
Enable doctest coverage in LCOV report
Add the --doctests flag to include documentation tests; keep the output path as coverage/lcov.info.
- File: Makefile
- Target: test-cov-lcov
- Lines: 35–39
-RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN) $(BUILD_JOBS)
+RUSTFLAGS="-D warnings" $(CARGO) llvm-cov --workspace --all-features --doctests --lcov --output-path coverage/lcov.info --fail-under-lines $(COV_MIN) $(BUILD_JOBS)🤖 Prompt for AI Agents
In Makefile around lines 35 to 39, the test-cov-lcov target omits the --doctests
flag so documentation tests are not included in the LCOV report; update the
llvm-cov invocation to add the --doctests flag while keeping the output path as
coverage/lcov.info so doctests are collected into the same LCOV file.
| - `make test-cov` – run workspace-wide tests with coverage and print a | ||
| text report. Set `COV_MIN=75` to fail if line coverage drops below 75% | ||
| - `make test-cov-lcov` – run workspace-wide tests with coverage and write | ||
| `coverage/lcov.info`. Also honours `COV_MIN` |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Document the cargo-llvm-cov prerequisite via a footnote.
Add a footnote marker to coverage targets and append the installation note. Keep wrapping at 80 columns.
Apply this diff:
-- `make test-cov` – run workspace-wide tests with coverage and print a
+- `make test-cov` – run workspace-wide tests with coverage and print a
text report. Set `COV_MIN=75` to fail if line coverage drops below 75%
-- `make test-cov-lcov` – run workspace-wide tests with coverage and write
+- `make test-cov-lcov` – run workspace-wide tests with coverage and write
`coverage/lcov.info`. Also honours `COV_MIN`Append this block at the end of the file:
[^cov]: Install the `cargo-llvm-cov` subcommand: `cargo install cargo-llvm-cov`.
Ensure the Rust toolchain includes the `llvm-tools_preview` component
(configured in `rust-toolchain.toml`).🤖 Prompt for AI Agents
In README.md around lines 17 to 20, the coverage target entries lack a footnote
marker and the installation note for cargo-llvm-cov; add a footnote marker (e.g.
[^cov]) to both `make test-cov` and `make test-cov-lcov` lines, then append the
supplied footnote block at the end of the file exactly as given, wrapped at ~80
columns, mentioning installation via `cargo install cargo-llvm-cov` and the need
for the `llvm-tools_preview` component in rust-toolchain.toml.
Summary
llvm-tools-previewcomponent to rust toolchain sollvm-covis available for coverageTesting
make fmtmake lintmake testmake test-covhttps://chatgpt.com/codex/tasks/task_e_6896894df8688322a7ffc33660fb44de
Summary by Sourcery
Introduce a coverage test target by adding llvm-tools-preview to the Rust toolchain and updating the Makefile and documentation to support running tests with coverage
New Features:
Enhancements:
Documentation: