Skip to content

Clarify test-body extraction failures - #535

Open
leynos wants to merge 1 commit into
test-quality-sweep-static-readersfrom
test-quality-sweep-io-code-emphasis
Open

leynos wants to merge 1 commit into
test-quality-sweep-static-readersfrom
test-quality-sweep-io-code-emphasis

Conversation

@leynos

@leynos leynos commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

This branch replaces 40 bare unwrap() calls in recognised test bodies with descriptive expect(...) messages, so a failing I/O or code-emphasis assertion identifies its extraction point. Shared helpers, test cases, and assertions retain their behaviour. It follows PR #534 in the test-quality sweep.

Review walkthrough

Validation

  • make check-fmt, make lint, make test, make typecheck, make markdownlint, make nixie, make verus, and make verus-selftest passed sequentially on current head d9ee1130fa4238da07e33b75d5293a0ed72c2ba2 against PR Simplify fixed-fixture policy reader tests #534 head 273e483058a79e0787f18e9a1908ae7b193e17b4. Logs: /tmp/mdtablefix-restack-after-529-20260924/535-<gate>-run1.out.
  • Range-diff and stable patch ID confirm the one-commit, two-file patch survived the parent replay unchanged; git diff --check and CodeScene CLI 1.0.33 found no issues.
  • Hosted CI (all six jobs), Verus, and CodeScene passed on this exact head. Managed CodeRabbit request 59e0b3d7 remains queued; the automatic check skipped this stacked base and is not a review.

Notes

The proposed final lint baseline remains in later source-fix layers. Phase 0 measured at least 997 Clippy sites and eight rustdoc errors before remediation, with integration-test targets incompletely measured. The repository has no spelling gate yet.

References

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 69b905d2-ae74-4623-87c9-ce91e5406128

📥 Commits

Reviewing files that changed from the base of the PR and between 273e483 and d9ee113.

📒 Files selected for processing (2)
  • src/io_tests.rs
  • tests/code_emphasis.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/netsuke (auto-detected)
  • leynos/df12-dylint-builds (auto-detected)
  • leynos/typos-config-builder (auto-detected)
  • leynos/falcon-correlate (auto-detected)
  • leynos/msgspec-crockford (auto-detected)
  • leynos/vk (auto-detected)
  • leynos/simulacat-core (auto-detected)
  • leynos/agent-template-python (auto-detected)
  • leynos/shared-actions (auto-detected)
  • leynos/cuprum (auto-detected)

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


A detailed high-level summary could not be generated for this review. Here is an overview derived from the analyzed file changes:

  • src/io_tests.rs: ## AI-generated summary of changes
  • tests/code_emphasis.rs: ## AI-generated summary of changes

Walkthrough

The test suites replace unwrap calls with expect calls that include descriptive failure messages. Test inputs, operations, and assertions remain unchanged.

Changes

Test failure messages

Layer / File(s) Summary
Add context to test failures
src/io_tests.rs, tests/code_emphasis.rs
I/O and CLI tests now report descriptive messages when setup, file operations, or CLI calls fail. Test scenarios and assertions remain unchanged.

Priority: ⬇️ Low

Change: Refactor

Merge Risk: ⚪ Minimal · up to d9ee1

Test behavior remains unchanged; this change only makes failures more descriptive, and no merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: replacing unclear test-body failures with clearer extraction failure messages. No roadmap item or issue reference is required by the provided context.
Description check ✅ Passed The description clearly explains the 40 unwrap-to-expect replacements, affected test files, preserved behaviour, and validation results. It is directly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Testing (Overall) ✅ Passed Pass this check. The authoritative diff changes only src/io_tests.rs and tests/code_emphasis.rs. It replaces existing unwrap() calls with descriptive expect(...) calls and leaves product code,…
User-Facing Documentation ✅ Passed Pass this check. The pull request changes only test files. It replaces test-only unwrap() calls with expect(...) messages and does not change user-facing functionality or behaviour. No user-guide …
Developer Documentation ✅ Passed Pass the developer documentation check. The pull request changes only error messages in test code: it replaces unwrap() with descriptive expect(...) calls in src/io_tests.rs and `tests/code_emph…
Module-Level Documentation ✅ Passed Pass the module-level documentation check. src/io_tests.rs starts with //! Unit tests for file rewriting., which states the module purpose and function. tests/code_emphasis.rs starts with docume…
Testing (Unit And Behavioural) ✅ Passed Pass the testing check. The PR changes only panic diagnostics in two existing test files: each changed unwrap() becomes expect(...), with no test input, assertion, helper, or production behaviour …
Testing (Property / Proof) ✅ Passed Pass this check. The reviewed diff changes only existing unwrap() calls to descriptive expect(...) calls in src/io_tests.rs and tests/code_emphasis.rs. It introduces no invariant, input genera…
Testing (Compile-Time / Ui) ✅ Passed PASS — The pull request changes only test failure handling in src/io_tests.rs and tests/code_emphasis.rs: it replaces unwrap() with descriptive expect(...) calls. It adds no compile-time behav…
Unit Architecture ✅ Passed Pass the Unit Architecture check. The diff changes only src/io_tests.rs and tests/code_emphasis.rs. It replaces 40 bare unwrap() calls with operation-specific expect(...) messages. It does not…
Domain Architecture ✅ Passed Pass this check. The reviewed range changes only src/io_tests.rs and tests/code_emphasis.rs. The diff replaces test-only unwrap() calls with descriptive expect(...) messages. It does not chang…
Observability ✅ Passed Pass the observability check. The diff changes only test code: src/io_tests.rs is included under #[cfg(test)], and tests/code_emphasis.rs is an integration-test file. The changes replace `unwrap…

Trade silent unwraps for messages bright,
Trace each test failure into sight.
Keep every check and input in place,
Let clearer clues reveal the case.
Send baffling errors on their way!

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

@sourcery-ai

sourcery-ai Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR improves diagnostics for 40 extraction failures across I/O and code-emphasis tests by replacing bare unwrap() calls with scenario-specific expect(...) messages, without changing test behavior or production code.

File-Level Changes

Change Details Files
Replace bare panics in I/O test setup and result extraction with contextual failure messages.
  • Add descriptive expect(...) messages for temporary directories, file reads/writes, rewrites, metadata, symlinks, and path extraction.
  • Preserve all existing test scenarios, expected errors, cleanup checks, and output assertions.
src/io_tests.rs
Clarify process-execution failures in code-emphasis CLI integration tests.
  • Replace four command-builder unwrap() calls with messages identifying the specific CLI scenario.
  • Leave CLI arguments, success expectations, output assertions, and file-content checks unchanged.
tests/code_emphasis.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@leynos
leynos marked this pull request as ready for review September 23, 2026 21:35

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 13 hours and 11 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T21:36:43.022219Z 91832f8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Replace bare test-body unwraps with operation-specific expect messages.
Keep the existing setup, assertions, and parameterized cases intact so
failures identify the unsuccessful I/O or CLI operation.
@leynos
leynos force-pushed the test-quality-sweep-io-code-emphasis branch from 91832f8 to d9ee113 Compare September 24, 2026 05:12
@wafflecat-df12

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

2 participants