Skip to content

test(cli): split diagnostics integration coverage - #198

Merged
errfld merged 1 commit into
mainfrom
gh-197/diagnostics-integration-tests
Aug 3, 2026
Merged

test(cli): split diagnostics integration coverage#198
errfld merged 1 commit into
mainfrom
gh-197/diagnostics-integration-tests

Conversation

@errfld

@errfld errfld commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • move all 14 status and doctor CLI scenarios into a focused diagnostics_integration target
  • preserve the moved test bodies byte-for-byte and remove them from the monolithic target
  • allow partial shared-fixture usage because Cargo compiles each integration target independently

TDD / validation

  • RED: cargo test -p git-smee-cli --test diagnostics_integration failed because the focused target did not exist
  • baseline: cargo test -p git-smee-cli --test cli_integration passed all 86 pre-split tests
  • GREEN: cargo test -p git-smee-cli --test diagnostics_integration (14 passed)
  • GREEN: cargo test -p git-smee-cli --test cli_integration (72 passed)
  • GREEN: cargo test -p git-smee-cli --all-targets --all-features
  • GREEN: cargo clippy -p git-smee-cli --all-targets --all-features -- -D warnings
  • GREEN: cargo fmt --all -- --check
  • structural parity check confirmed the 14 moved test bodies are unchanged, absent from the old target, and present exactly once in the new target

Fixes #197

Summary by CodeRabbit

  • Tests
    • Added comprehensive coverage for diagnostic commands in human-readable and JSON formats.
    • Verified reporting for healthy, missing, unmanaged, stale, and obsolete hooks.
    • Added checks for configuration errors, malformed settings, custom hook paths, marker detection, and drift reporting.
    • Confirmed status checks do not modify installations.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bcb3e224-0902-49d2-b959-98c403c53c48

📥 Commits

Reviewing files that changed from the base of the PR and between d06e8aa and fc7a550.

📒 Files selected for processing (3)
  • crates/git-smee-cli/tests/cli_integration.rs
  • crates/git-smee-cli/tests/common.rs
  • crates/git-smee-cli/tests/diagnostics_integration.rs
💤 Files with no reviewable changes (1)
  • crates/git-smee-cli/tests/cli_integration.rs

📝 Walkthrough

Walkthrough

The pull request extracts doctor and status integration tests into diagnostics_integration.rs. It preserves coverage for text and JSON output, hook states, markers, configuration errors, custom hook paths, and stale wrappers. The shared fixture now allows unused code.

Changes

Diagnostics integration test extraction

Layer / File(s) Summary
Diagnostics test target and shared fixture
crates/git-smee-cli/tests/cli_integration.rs, crates/git-smee-cli/tests/diagnostics_integration.rs, crates/git-smee-cli/tests/common.rs
Diagnostics tests move to a focused integration target. Healthy doctor and status output remains covered in text and JSON formats. The shared fixture permits subset usage by separate integration targets.
Status state and marker coverage
crates/git-smee-cli/tests/diagnostics_integration.rs
Status tests cover unmanaged, missing, stale, and obsolete hooks. They also verify marker detection, drift reporting, recommended actions, and non-mutating behavior.
Doctor configuration and hook-path coverage
crates/git-smee-cli/tests/diagnostics_integration.rs
Doctor tests cover missing or malformed configuration, unmanaged hooks, marker handling, custom hooks paths, stale wrappers, remediation text, and warning status.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • errfld/git-smee#162: Introduced earlier doctor and status integration coverage that this pull request relocates.
  • errfld/git-smee#167: Extracted the status::run_status behavior exercised by these tests.
  • errfld/git-smee#168: Extracted the doctor.rs implementation exercised by these tests.

Poem

A rabbit hops through tests anew,
Doctor checks and status too.
Hooks and markers line the way,
JSON joins the bright display.
One focused burrow now they share.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the focused extraction of diagnostics integration test coverage.
Linked Issues check ✅ Passed The changes move doctor and status scenarios to a focused target, preserve coverage, retain shared fixtures, and leave production code unchanged.
Out of Scope Changes check ✅ Passed The changes are limited to relocating diagnostics tests and adjusting shared fixture dead-code handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gh-197/diagnostics-integration-tests

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.

@errfld
errfld merged commit 1cbe661 into main Aug 3, 2026
28 checks passed
@errfld
errfld deleted the gh-197/diagnostics-integration-tests branch August 3, 2026 06:23
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.

Extract status and doctor coverage from the monolithic CLI integration target

2 participants