Skip to content

Run the helper crates' tests in the gate - #748

Open
leynos wants to merge 1 commit into
mainfrom
whitaker-scope
Open

leynos wants to merge 1 commit into
mainfrom
whitaker-scope

Conversation

@leynos

@leynos leynos commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Part of DF12-120.

default-members = ["."] keeps cargo nextest run and cargo test on the root package, so the tests and doctests of cli-defs and test-util (including the fixture_fs tests from #745) never ran in the gate. validator is the one member left out on purpose: its tests need a built server and run through make test-validator-sqlite (the CI nextest step already excludes it by filter).

  • Adds make test-helper-crates (nextest run -p cli-defs -p test-util plus cargo test --doc for both), part of make test, and a Test helper crates step in the wireframe-only CI leg.
  • Documents the target.

Coverage evidence (independent: members from cargo metadata --no-deps; checked test units from cargo nextest list --message-format json, unioned over every existing nextest invocation in make test: the sqlite feature set, -p rstest-bdd-ui-tests, -p mxd-verification, -p fuzz, -p mxd-concurrency):

  • Before: no test unit of cli-defs, test-util or validator was listed by any invocation.
  • After: cli-defs and test-util are listed (28 tests, all pass locally with their doctests); validator stays out, by name and reason above.

Clippy and Whitaker already select the whole workspace (--workspace). Verified locally: make check-fmt, make test-helper-crates.

Summary by Sourcery

Include the helper crates’ tests and doctests in the standard test and CI gates.

New Features:

  • Add a dedicated target for running the cli-defs and test-util unit tests and doctests.

Bug Fixes:

  • Ensure helper-crate tests are included in the standard test gate instead of being skipped by workspace default-members.

CI:

  • Run helper-crate tests in the wireframe-only CI job.

Documentation:

  • Document the new helper-crate test target in the developers guide.

default-members = ["."] keeps cargo nextest run off the helper crates,
so their tests (including the new fixture_fs tests) never ran. Add
make test-helper-crates, part of make test and of the wireframe-only CI
leg.
@pandalump

Copy link
Copy Markdown

@coderabbitai Does this PR meet its stated purpose: after it, every workspace member except validator (named, with its reason) has its tests and doctests run by make test or CI, and is anything left that cargo nextest run / cargo test / cargo clippy misses? Please give a clear verdict on whether anything blocks merging at the current head.

@sourcery-ai

sourcery-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T04:58:44.327848Z
We couldn’t complete this review. Comment @codex review to try again.
d94410d PR opened
🔒 Security Review ❌ Failed 2026-11-26T04:58:49.254190Z
We couldn’t complete this review. Comment @codex security review to try again.
d94410d PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

@sourcery-ai

sourcery-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Configuration

Add the helper-crate test target to make test and run it in the wireframe-only CI leg.

  • .github/workflows/ci.yml L223-225
  • Makefile L1, L309-311, L380-387

Documentation

Document the helper-crate test target alongside the other test targets.

  • docs/developers-guide.md L1892-1898

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

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Adds the make test-helper-crates target. It runs nextest tests and doctests for cli-defs and test-util. The test target now depends on it. The build-test job runs it on the wireframe-only matrix leg. The .PHONY list and the Loom models table in docs/developers-guide.md are updated. No public API changes. validator stays excluded, because its tests need a built server.

Walkthrough

The Makefile adds a target for tests and doctests in cli-defs and test-util, and includes it in make test. CI runs the target on the wireframe-only matrix leg. The developers guide documents the target.

Changes

Helper crate tests

Layer / File(s) Summary
Define and include helper-crate tests
Makefile
The Makefile adds test-helper-crates to .PHONY. The target runs tests and doctests for cli-defs and test-util. The test target depends on it.
Wire and document the test target
.github/workflows/ci.yml, docs/developers-guide.md
The CI workflow runs make test-helper-crates on the wireframe-only matrix leg. The developers guide documents the target and its tests and doctests.

Suggested reviewers: codescene-access

Change: Other

Merge Risk: Minimal · up to d9441

This adds CI and local test coverage for two helper crates and documents the new target. No concrete merge-blocking risk was found.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

Failed Failed checks: 10 inconclusive

Check name Status Explanation Resolution
Testing (Overall) Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
User-Facing Documentation Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Developer Documentation Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Module-Level Documentation Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Testing (Unit And Behavioural) Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Testing (Property / Proof) Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Testing (Compile-Time / Ui) Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Unit Architecture Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Domain Architecture Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Observability Inconclusive Pull request inputs changed after this check was assessed; its verdict is no longer current. Re-run the check against the current pull request inputs.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title "Run the helper crates' tests in the gate" matches the main change: the PR adds a make test-helper-crates target that runs nextest and doctests for cli-defs and test-util, and wires it into …
Description check Passed The description explains the purpose of the change. It states that default-members keeps cargo nextest run and cargo test on the root package, so cli-defs and test-util tests never ran in the gate. It…
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.
Full details: Title check

Explanation

The title "Run the helper crates' tests in the gate" matches the main change: the PR adds a make test-helper-crates target that runs nextest and doctests for cli-defs and test-util, and wires it into make test and CI. It does not reference a roadmap item or issue number, and the PR description cites DF12-120 and #745 only as context, so no reference is required by the title requirements. The title is specific and accurate.

Full details: Description check

Explanation

The description explains the purpose of the change. It states that default-members keeps cargo nextest run and cargo test on the root package, so cli-defs and test-util tests never ran in the gate. It lists the new make target, the CI step, and the documentation update. It also explains why validator is excluded and reports local verification.

Two helper crates join the test,
Their doctests follow close behind.
A Make target sets the steps,
CI runs them on its chosen leg,
The guide records the path to find.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: e25aecd9-84d6-445c-a3eb-fbe42d700de7
Commits

Reviewing files that changed from the base of the PR and between 0af758d and d94410d.

Files selected for processing: 3

  • .github/workflows/ci.yml
  • Makefile
  • docs/developers-guide.md
Linked repositories identified

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

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@codescene-access codescene-access 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.

No application code in the PR — skipped Code Health checks.

See analysis details in CodeScene

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -u
printf '%s\n' '=== checkout ==='
git rev-parse HEAD
printf '%s\n' '=== root manifest ==='
cat -n Cargo.toml | sed -n '1,240p'
printf '%s\n' '=== relevant Makefile lines ==='
rg -n -C 5 '(^\.PHONY|^test[^: ]*:|^test-[^: ]*:|^lint[^: ]*:|cargo (nextest|test|clippy)|whitaker|validator)' Makefile
printf '%s\n' '=== CI workflow ==='
cat -n .github/workflows/ci.yml | sed -n '1,260p'
printf '%s\n' '=== manifest locations ==='
fd -H -t f '^Cargo\.toml$' -E target -E .git
printf '%s\n' '=== repository guidance locations ==='
fd -H -t f '^(AGENTS\.md|CLAUDE\.md|CONTRIBUTING\.md)$' -E .git

Length of output: 37957


Script executed:

#!/bin/bash
set -u
printf '%s\n' '=== pull request metadata ==='
gh api repos/leynos/mxd/pulls/748 --jq '{number,state,draft,mergeable,mergeable_state,head:{sha:.head.sha,ref:.head.ref},base:{sha:.base.sha,ref:.base.ref},title,updated_at}'
printf '%s\n' '=== current PR checks ==='
gh pr checks 748 --repo leynos/mxd
printf '%s\n' '=== submitted reviews ==='
gh api --paginate repos/leynos/mxd/pulls/748/reviews --jq '.[] | {user:.user.login,state,commit_id,submitted_at,body}'
printf '%s\n' '=== review threads ==='
gh api graphql -F owner=leynos -F name=mxd -F number=748 -f query='query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner,name:$name) { pullRequest(number:$number) { reviewThreads(first:100) { pageInfo { hasNextPage endCursor } nodes { isResolved isOutdated comments(first:10) { nodes { author { login } body path line } } } } } } }'

Length of output: 4140


Script executed:

#!/bin/bash
set -u
printf '%s\n' '=== repository instructions ==='
cat -n AGENTS.md | sed -n '1,240p'
printf '%s\n' '=== workspace member manifests ==='
for f in cli-defs/Cargo.toml crates/mxd-concurrency/Cargo.toml crates/mxd-verification/Cargo.toml fuzz/Cargo.toml test-util/Cargo.toml tests/rstest-bdd-ui/Cargo.toml validator/Cargo.toml; do
  printf '\n=== %s ===\n' "$f"
  cat -n "$f" | sed -n '1,180p'
done
printf '%s\n' '=== remaining CI jobs and test commands across workflows ==='
cat -n .github/workflows/ci.yml | sed -n '260,620p'
rg -n -C 3 'cargo (test|nextest|clippy|llvm-cov)|make test|mxd-verification|rstest-bdd-ui|fuzz|doctest' .github/workflows
printf '%s\n' '=== Makefile feature and flag definitions ==='
cat -n Makefile | sed -n '1,125p'
printf '%s\n' '=== rust doc fences and test annotations in workspace packages ==='
rg -n -C 2 '^\s*(//!|///|/\*\*| \*)\s*(```|~~~|# Examples|# Example)|#\[(test|rstest|cfg\(test\))\]|doctest\s*=' crates/mxd-verification fuzz tests/rstest-bdd-ui cli-defs test-util crates/mxd-concurrency --glob '*.rs' --glob 'Cargo.toml' | head -400
printf '%s\n' '=== PR changes ==='
git diff --stat origin/main...HEAD
git diff --unified=8 origin/main...HEAD -- Makefile .github/workflows/ci.yml docs/developers-guide.md

Length of output: 85394


Script executed:

#!/bin/bash
set -u
printf '%s\n' '=== repository instructions on testing ==='
cat -n AGENTS.md | sed -n '235,300p'
printf '%s\n' '=== fuzz doctest ==='
ast-grep outline fuzz/src/lib.rs --match is_oversized --view expanded
cat -n fuzz/src/lib.rs | sed -n '1,35p'
printf '%s\n' '=== verification library documentation examples ==='
rg -n -C 2 '^\s*(///|//!|\*)\s*(```|~~~|# Example)|#\[doc' crates/mxd-verification/src --glob '*.rs' || true
printf '%s\n' '=== UI crate target files ==='
fd -H -t f '\.rs$' tests/rstest-bdd-ui | head -35
printf '%s\n' '=== postgres-gated test-util modules and tests ==='
rg -n -C 4 'postgres|retry_tests|test_errors|cfg\(test\)' test-util/src/lib.rs test-util/src/postgres/mod.rs test-util/src/postgres/retry_tests.rs test-util/src/postgres/test_errors.rs | head -220
printf '%s\n' '=== relevant guidance and documentation ==='
rg -n -C 3 'test-fuzz-harness|test-verification|test-helper-crates|test-doc|doctests|test-util.*postgres' docs/developers-guide.md .github/workflows/ci.yml Makefile | head -220

Length of output: 23076


Script executed:

#!/bin/bash
set -u
printf '%s\n' '=== pinned public shared coverage action ==='
curl --fail --silent --show-error --max-time 20 'https://raw.githubusercontent.com/leynos/shared-actions/f84a7def5646a6fc7ba77c1f486906f66a0fed96/.github/actions/generate-coverage/action.yml' | nl -ba | sed -n '1,260p'
printf '%s\n' '=== refreshed head and mergeability ==='
gh api repos/leynos/mxd/pulls/748 --jq '{head:.head.sha,mergeable,mergeable_state,updated_at}'
printf '%s\n' '=== refreshed checks ==='
gh pr checks 748 --repo leynos/mxd || true

Length of output: 15777


Script executed:

#!/bin/bash
set -u
base='https://raw.githubusercontent.com/leynos/shared-actions/f84a7def5646a6fc7ba77c1f486906f66a0fed96/.github/actions/generate-coverage'
printf '%s\n' '=== action coverage steps ==='
curl --fail --silent --show-error --max-time 20 "$base/action.yml" | nl -ba | grep -n -C 10 -E 'llvm|nextest|doctest|scripts/.*\.py|workspace'
printf '%s\n' '=== public action scripts tree ==='
gh api 'repos/leynos/shared-actions/contents/.github/actions/generate-coverage/scripts?ref=f84a7def5646a6fc7ba77c1f486906f66a0fed96' --jq '.[] | [.name,.download_url] | @tsv'

Length of output: 17834


Script executed:

#!/bin/bash
set -u
base='https://raw.githubusercontent.com/leynos/shared-actions/f84a7def5646a6fc7ba77c1f486906f66a0fed96/.github/actions/generate-coverage/scripts'
for f in run_rust.py _cargo_runner.py _build_only.py; do
  printf '\n=== %s ===\n' "$f"
  curl --fail --silent --show-error --max-time 20 "$base/$f" | nl -ba | grep -n -C 6 -E 'workspace|llvm-cov|nextest|features|doctest|command|cargo_args|cargo_flags|build_command'
done

Length of output: 33781


@pandalump Verdict: do not merge yet. The PR selects the cli-defs and test-util tests and doctests, but it does not meet the broader requirement that every non-validator member’s doctests run through make test or CI.

  • Fix the doctest gap. With nextest installed, make test-verification and make test-fuzz-harness run ordinary tests but not doctests (Makefile, Lines 374–378). Both crates have runnable doctests: crates/mxd-verification/src/session_model/mod.rs Line 14 and fuzz/src/lib.rs Line 19. The CI coverage action selects the workspace, but its doctest input defaults to false and CI does not enable it.
  • Run the missing doctests in the gate. Select cargo test --doc -p mxd-verification -p fuzz, or an equivalent workspace doctest command that preserves the intended exclusions. Verify that the selected doctests pass.
  • Keep validator separate. Its tests need a built server. CI runs them through make test-validator-sqlite in a separate job.

For ordinary tests, make test selects every non-validator member. Its helper target uses test-util’s SQLite default, so it does not select that crate’s PostgreSQL-only unit tests locally. The CI coverage action selects the workspace with PostgreSQL features, but that job was still pending at the last lookup.

From the workspace root, bare cargo nextest run, cargo test and cargo clippy select only the root default member. Nextest also does not run doctests. CI’s Clippy command uses --workspace --all-targets for three feature sets, so it is broader than bare Clippy, but it does not cover every feature combination.

At the last lookup, GitHub reported the head as blocked, with several checks pending. Let the required checks finish and pass before merging. I inspected the configuration; I did not run the tests.

You are interacting with an AI system.

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