Skip to content

Extract oversized core integration test modules - #296

Open
leynos wants to merge 1 commit into
harden-bench-target-layoutfrom
harden-integration-test-modules
Open

leynos wants to merge 1 commit into
harden-bench-target-layoutfrom
harden-integration-test-modules

Conversation

@leynos

@leynos leynos commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

This branch moves the assignment-validation cases and their independent model
from an oversized core integration test root into a private sibling module. It
also moves the functional clustering quality assertion into a private sibling
module. Both Cargo integration test roots and the existing test function
identifiers remain; every affected Rust file is below the 400-line module
budget.

This structural layer follows #295
and precedes the assertion-message lint wave.

Review walkthrough

Validation

  • Static comparison: all 37 function identifiers preserved; ten top-level Cargo integration roots unchanged; affected file lengths are 352, 112, 392 and 16 lines; git diff --check passed.
  • Focused make test NEXTEST_ARGS='-p chutoro-core --test chutoro --test functional_ari_nmi': 714 Nextest tests passed, with the established skips and stable verification leaves. The initial formatter check requested only module declaration ordering; that correction was applied before the final gate run.
  • Final sequential gates: make check-fmt, make spelling, make markdownlint, make nixie, make typecheck, make lint (including Whitaker), make test-workflow-contracts (446 passed), and make test (1,242 Nextest tests passed, three established skips, plus stable API, SIMD and poisoned-lock checks) all passed.
  • make verus: 21 and 4 proofs verified. make kani: six configured harnesses verified. Stable cargo test --workspace --doc --all-features with warnings denied: 137 passed, 17 ignored.
  • Independent review confirmed the moves preserve test bodies and leave Cargo target discovery unchanged. Gate logs: /tmp/chutoro-c7059fd9-integration-test-structure/gates-20260924-run2/.

Notes

Moved assignment tests gain an assignment_validation:: segment in their fully qualified Rust harness names. No repository Make, Nextest or CI selector names these cases exactly.

Ancestor #282 is blocked by hosted CodeScene project configuration lacking gates, tracked in #283. This branch's hosted checks and changed-line coverage require separate current-head assessment.

Summary by Sourcery

Extract oversized core integration-test components into focused private sibling modules without changing test behavior or discovery.

Enhancements:

  • Split assignment-validation tests and their independent model into a dedicated private integration-test module.
  • Move the clustering-quality assertion into a dedicated private module while preserving existing test behavior and identifiers.

Tests:

  • Preserve the existing Cargo integration-test roots and test coverage while keeping affected modules within the project’s size budget.

References

Move assignment-validation cases and their model into a sibling module,
and move the functional clustering quality assertion into another. Keep
Cargo test roots and test bodies intact while bringing both oversized
integration-test files under the 400-line module budget.
@coderabbitai

coderabbitai Bot commented Sep 24, 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: 58214944-d89c-46d4-b672-00c1216ad4f5

📥 Commits

Reviewing files that changed from the base of the PR and between 3710f46 and 7a949dc.

📒 Files selected for processing (4)
  • chutoro-core/tests/chutoro.rs
  • chutoro-core/tests/chutoro/assignment_validation.rs
  • chutoro-core/tests/functional_ari_nmi.rs
  • chutoro-core/tests/functional_ari_nmi/quality.rs
🔗 Linked repositories identified

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

  • leynos/whitaker (auto-detected)
  • leynos/typos-config-builder (auto-detected)
  • leynos/shared-actions (auto-detected)
  • leynos/mdtablefix (auto-detected)
  • leynos/df12-www (auto-detected)

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


Summary

  • Move assignment-validation tests and their independent model into chutoro-core/tests/chutoro/assignment_validation.rs.
  • Move the clustering-quality assertion helper into chutoro-core/tests/functional_ari_nmi/quality.rs.
  • Keep the Cargo integration-test roots and test function identifiers. Moved assignment tests gain an assignment_validation:: segment in fully qualified harness names.
  • Keep the affected Rust files within the 400-line budget.

Validation

  • The author reports that formatting, lint, workflow-contract and test gates passed.
  • The author reports 714 focused Nextest tests and 1,242 full Nextest tests passed, with established skips.
  • Hosted checks and changed-line coverage require separate current-head assessment.

Walkthrough

The test suite moves assignment-validation tests into a dedicated module and moves the shared quality-score assertion helper into a separate module.

Changes

Assignment Validation Tests

Layer / File(s) Summary
Assignment validation test coverage
chutoro-core/tests/chutoro.rs, chutoro-core/tests/chutoro/assignment_validation.rs
The test module imports the new validation module. The new module adds example cases and a property test that compares try_from_assignments with an independent model. The previous inline model and tests are removed.

Quality Assertion Helper

Layer / File(s) Summary
Quality-score assertion helper
chutoro-core/tests/functional_ari_nmi.rs, chutoro-core/tests/functional_ari_nmi/quality.rs
The functional tests import the helper from the new module. The helper checks that the score differs from 1.0 by no more than 1.0e-12.

Priority: ⬇️ Low

Change: Refactor

Merge Risk: ⚪ Minimal · up to 7a949

No actionable merge-blocking issue is established; the change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: extracting oversized core integration-test modules. No roadmap or issue reference is required because the description does not identify a roadmap task o…
Description check ✅ Passed The description clearly explains the module extractions, preserved test behaviour, validation results, and related references. It is directly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 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 reviewed range changes only integration-test files and introduces no production behaviour. The moved assignment tests retain explicit cases for missing zero, gaps, overflow, dupli…
User-Facing Documentation ✅ Passed Pass this check. The pull request changes only private integration-test modules and test helper placement. It introduces no user-facing functionality, API behaviour, breaking change, or interface chan…
Developer Documentation ✅ Passed Pass. The PR changes only private Rust integration-test modules: it extracts assignment-validation tests and a quality assertion, with no production API, architecture, build requirement, tooling, road…
Module-Level Documentation ✅ Passed Pass. Every changed Rust module has a module-level //! docstring. The new assignment_validation module documents its validation examples and independent contiguity model. The new quality module …
Testing (Unit And Behavioural) ✅ Passed Pass the testing check. The pull request only extracts existing tests and helpers. assignment_validation.rs still exercises the public ClusteringResult::try_from_assignments API with valid assignm…
Testing (Property / Proof) ✅ Passed Pass the check. The pull request only extracts existing tests and helper logic. The assignment-validation property test and independent model are byte-identical to the removed block in the base test r…
Testing (Compile-Time / Ui) ✅ Passed Pass this check. The PR only extracts existing Rust integration-test code into private sibling modules. The diff introduces no compile-time API or compile-fail behaviour, so no trybuild-equivalent tes…
Unit Architecture ✅ Passed The pull request only restructures Rust integration-test modules. The review-scoped diff changes four files under chutoro-core/tests and changes no production code. assignment_validation contains …
Domain Architecture ✅ Passed Pass the Domain Architecture check. The authoritative diff changes only four chutoro-core/tests files and changes no production domain code. The new modules contain test validation logic and a test …
Observability ✅ Passed Treat this change as non-operational. The authoritative diff only moves existing Rust integration-test cases and a test assertion helper into private sibling modules, with no production code, logging,…

Move the tests to a clearer place,
Check each cluster, case by case.
Keep the quality threshold near,
Let precise assertions steer.
Run the checks and watch them shine,
One point, within the tolerance line.

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

@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Refactors two oversized core integration-test roots into private sibling modules, preserving existing test bodies, function identifiers, Cargo integration-test discovery, and behavior while keeping all affected files within the module-size budget.

File-Level Changes

Change Details Files
Extract assignment-validation integration tests and their independent model into a private child module without changing test logic or Cargo test-root discovery.
  • Added the assignment-validation module declaration using an explicit path.
  • Moved rstest cases, the property-based test, and model implementation together.
  • Removed now-unused imports from the orchestration root.
chutoro-core/tests/chutoro.rs
chutoro-core/tests/chutoro/assignment_validation.rs
Extract the clustering-quality helper into a private sibling module while retaining access from the functional test root.
  • Added the quality module declaration and imported its helper.
  • Moved the tolerance constant and assertion implementation unchanged.
  • Used child-to-parent visibility for the helper.
chutoro-core/tests/functional_ari_nmi.rs
chutoro-core/tests/functional_ari_nmi/quality.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 24, 2026 07:16

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

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 3 hours and 30 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 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-24T07:17:54.560645Z 7a949dc 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.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 25, 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