Skip to content

Restore standard filter integration tests (#520) - #521

Merged
leynos merged 9 commits into
mainfrom
issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025
Aug 7, 2026
Merged

Restore standard filter integration tests (#520)#521
leynos merged 9 commits into
mainfrom
issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025

Conversation

@lodyai

@lodyai lodyai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restore the Cargo-discovered std_filter_tests integration-test binary and
    repair nine months of compilation, localization, isolation, and behavioural
    drift.
  • Remove basic expanduser, fetch-cache, and which cases whose coverage is
    duplicated by stdlib.feature or stdlib_which_tests.
  • Add a capability-backed regression guard that rejects orphaned
    tests/*/mod.rs trees.

Closes #520

Validation

  • make check-fmt
  • make markdownlint
  • make nixie
  • make test (1,370 nextest tests and all doctests passed)
  • make typecheck
  • make lint (Rustdoc, Clippy, and Whitaker passed)
  • mbake validate Makefile
  • cargo nextest list --list-type binaries-only includes
    netsuke::std_filter_tests and netsuke::integration_test_wiring_tests
  • coderabbit review --agent (zero findings, before and after the stack-base
    rebase)

The Windows-only setup now uses injected DefaultEnv.os_string("PATH"); the
previous #[expect(clippy::disallowed_methods)] is no longer needed. A Linux
cross-target check was attempted, but ring requires the unavailable MSVC
lib.exe before Netsuke's Windows test code can be checked on this host.

References


Stack created with GitHub Stacks CLIGive Feedback 💬

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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

Summary

Restore the Cargo-discovered netsuke::std_filter_tests integration-test binary and repair its module paths.

  • Isolate filesystem fixtures with cap_std workspaces.
  • Normalize Fluent isolates in diagnostic assertions.
  • Update command fixture configuration and test helpers.
  • Remove duplicate expanduser, fetch-cache, and which coverage.
  • Add with_suffix path-filter coverage.
  • Add a regression guard for orphaned tests/*/mod.rs trees.
  • Document integration-test wiring and fixture ownership.
  • Validate formatting, linting, type checking, documentation, Makefile checks, 1,370 nextest tests, and doctests.

Walkthrough

The change adds a guard for orphaned integration-test module trees. It updates stdlib filter fixtures to use isolated filesystem access, closure-based configuration, improved diagnostics, and dedicated with_suffix coverage.

Changes

Integration test maintenance

Layer / File(s) Summary
Test binary wiring contract
docs/developers-guide.md, tests/integration_test_wiring_tests.rs, tests/std_filter_tests.rs
Document Cargo’s top-level integration-test discovery rule and test wired, orphaned, and commented-out module trees.
Command filter fixtures
tests/std_filter_tests/command_filters/*
Make CommandFixture::with_config accept configuration closures, add structured ShellCase data, isolate workspaces, and normalize diagnostic assertions.
Shared test support and filesystem isolation
tests/std_filter_tests/support.rs, tests/std_filter_tests/which_filter_common.rs, tests/std_filter_tests/which_filter_tests.rs
Restrict support re-exports, use shared filesystem helpers, and strengthen tool lookup, cache, workspace, and diagnostic checks.
Filter diagnostics and policy tests
tests/std_filter_tests/collection_filters.rs, tests/std_filter_tests/hash_filters.rs, tests/std_filter_tests/io_filters.rs, tests/std_filter_tests/network_functions.rs
Normalize Fluent isolates, simplify network-policy transforms, remove cache coverage, and reformat assertions without changing the remaining test behaviour.
Path filter coverage
tests/std_filter_tests/path_filters.rs, tests/std_filter_tests/path_filters/with_suffix.rs
Move with_suffix cases into a dedicated module and cover replacement, appending, validation, and excessive-count behaviour.
Command error assertions
src/stdlib/command/error.rs
Use one private helper for spawn and timeout error-kind and message assertions.

Possibly related PRs

Suggested labels: Issue

Suggested reviewers: leynos

Poem

Wire every test tree; leave no module unseen.
Isolate each workspace with paths kept clean.
Normalize diagnostics; keep error checks clear.
Add suffix cases; restore coverage here.
Run the filters: the missing tests appear.


Important

Pre-merge checks failed

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

❌ Failed checks (1 warning, 3 inconclusive)

Check name Status Explanation Resolution
Testing (Compile-Time / Ui) ⚠️ Warning The PR changes Cargo/Rust integration-test wiring, but adds only runtime source-scanning tests; no trybuild or equivalent compilation test covers the restored target and module paths. Add a Rust compile-time-equivalent test that builds representative wired and invalid module trees, or explicitly verifies Cargo target discovery and path resolution.
Testing (Overall) ❓ Inconclusive Investigation has not yet established whether the new and repaired tests are substantive. Inspect the complete pull-request diff and test oracles before deciding.
User-Facing Documentation ❓ Inconclusive Placeholder parallel call; final assessment requires repository diff inspection. Inspect the complete pull request diff and user-facing behaviour before deciding.
Developer Documentation ❓ Inconclusive Investigation is still in progress; no final assessment yet. Inspect the changed documentation and implementation boundaries before deciding.
✅ Passed checks (16 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes restoring the standard filter integration tests and includes the linked issue reference (#520).
Description check ✅ Passed The description directly explains the restored test target, repaired tests, removed duplicate coverage, and added orphan-tree protection.
Linked Issues check ✅ Passed The changes satisfy issue #520 by restoring the target, repairing tests, removing duplicate coverage, adding a wiring guard, and rechecking Windows lint.
Out of Scope Changes check ✅ Passed The changes remain within issue #520, including test repairs, fixture updates, diagnostics, formatting, and a test helper supporting the repaired suite.
Docstring Coverage ✅ Passed Docstring coverage is 93.33% which is sufficient. The required threshold is 80.00%.
Module-Level Documentation ✅ Passed All PR Rust modules have module-level //! documentation; inline fallible and tests modules are also documented with their purpose and role.
Testing (Unit And Behavioural) ✅ Passed Initial inspection shows restored integration tests exercise rendered stdlib and command workflows, error and limit paths, filesystem isolation, and a property-backed wiring contract.
Testing (Property / Proof) ✅ Passed The new orphan-tree invariant uses substantive proptest coverage over names, declaration forms, aliases, comments, indentation, and ordering; handwritten fixtures cover key concrete cases.
Unit Architecture ✅ Passed Pass the check: changed helpers return explicit Results, command fixtures inject StdlibConfig, and tests isolate filesystem/network/process effects in scoped fixtures.
Domain Architecture ✅ Passed The PR changes only integration-test wiring, test fixtures, diagnostics, and documentation; it does not alter domain logic or introduce infrastructure dependencies into domain code.
Observability ✅ Passed The PR changes only integration tests, test helpers, and developer documentation; it does not alter production operational behaviour or introduce a new runtime failure mode requiring observability.
Security And Privacy ✅ Passed The PR changes only tests, documentation, and a cfg(test) helper; scans found no secrets, credentials, sensitive data, or new production security-boundary changes.
Performance And Resource Use ✅ Passed Keep the change: no production hot path changed; the new scan handles 6 module roots and 66 sources (~526 KB), while property fixtures cap at five trees.
Concurrency And State ✅ Passed Keep this change: fixtures own TempDir, StdlibConfig and StdlibState; overrides avoid process-wide environment mutation, and HTTP work has join/drop cleanup.
Architectural Complexity And Maintainability ✅ Passed Approve: keep the test-only guard, CommandFixture, and ShellCase; each has a narrow boundary, immediate reuse, no new dependency, and documented ownership.
Rust Compiler Lint Integrity ✅ Passed Retain the current structure: the PR adds no broad lint suppression or artificial anchor, narrows support re-exports, and uses the added clones for owned snapshots or borrowed fixture data.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025

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

codescene-access[bot]

This comment was marked as outdated.

@sourcery-ai

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Restores and hardens the std_filter integration-test target by re-wiring it as a top-level Cargo test, tightening its command/network/filesystem capabilities, extracting some scenarios into more focused modules, and adding a guard that ensures tests/*/mod.rs module trees are actually wired to Cargo-discovered integration tests.

Flow diagram for Cargo integration-test discovery and wiring guard

flowchart TD
    cargo[Cargo integration_test discovery]
    tests_dir[tests directory]
    wiring_tests[integration_test_wiring_tests]
    std_filter_tests[std_filter_tests.rs]
    std_filter_tree[tests/std_filter_tests/mod.rs tree]

    cargo --> tests_dir
    tests_dir --> std_filter_tests
    tests_dir --> wiring_tests
    wiring_tests --> std_filter_tree

    wiring_tests -->|asserts| std_filter_tests
    std_filter_tree -->|must have| std_filter_tests
Loading

File-Level Changes

Change Details Files
Rewire std_filter integration tests as a Cargo-discovered target and add structural wiring guards.
  • Rename std_filter_tests integration test root from a module tree to a top-level tests/std_filter_tests.rs source so Cargo discovers it as a binary.
  • Add integration_test_wiring_tests contract tests that scan tests/ for tests//mod.rs trees and assert each has a corresponding tests/.rs source declaring the module.
  • Implement helpers to read integration-test sources and detect orphaned module trees by matching mod name declarations or explicit #[path] usages.
tests/std_filter_tests/mod.rs
tests/std_filter_tests.rs
tests/integration_test_wiring_tests.rs
Refactor path filter tests by extracting with_suffix coverage into a dedicated module and simplifying helpers.
  • Reorganize imports and types in path_filters to reduce unused helpers and rely on Utf8Path instead of Utf8PathBuf where possible.
  • Remove the generic FilterSuccessSpec/assert_filter_success_with_env helpers and the expanduser success case that is now covered elsewhere.
  • Move with_suffix integration tests into a new path_filters/with_suffix.rs module and re-export it via #[path] in path_filters.rs.
tests/std_filter_tests/path_filters.rs
tests/std_filter_tests/path_filters/with_suffix.rs
Tighten which filter tests to use capability-based filesystem helpers and focus on cache, duplicate, and cwd_mode behaviour.
  • Replace direct std::fs and env/cwd manipulation with test_support::fs helpers and StdlibConfig workspace overrides.
  • Change assertions from assert!/assert_eq! to anyhow::ensure with contextual messages for better diagnostics.
  • Drop first-match, all-match, missing-command, and workspace-fallback scenarios that are duplicated by BDD suites and stdlib_which_tests while keeping cache-removal, duplicate canonicalization, cwd_mode validation, and workspace override tests.
  • Ensure which tests reset impurity state and verify pure vs impure behaviour explicitly.
tests/std_filter_tests/which_filter_tests.rs
tests/std_filter_tests/which_filter_common.rs
Harden command filter tests (shell and grep) around workspace scoping, output/stream limits, and fluent error messages.
  • Introduce ShellCase to parameterize shell_filter_behaviour cases instead of multiple parallel parameter lists.
  • Refactor CommandFixture to always create a capability-scoped workspace Dir and StdlibConfig::new(...).with_workspace_root_path(...), and to accept a configurator closure for command budget tuning.
  • Switch shell and grep tests to use normalize_fluent_isolates when asserting on localized error messages and to rely on test_support::fs for file I/O and metadata.
  • Ensure streaming and limit-enforcement tests assert impurity flags via fixture.state()/StdlibState and use workspace-backed tempfiles instead of ad-hoc filesystem operations.
tests/std_filter_tests/command_filters/mod.rs
tests/std_filter_tests/command_filters/shell_filter_tests.rs
tests/std_filter_tests/command_filters/grep_filter_tests.rs
tests/std_filter_tests/command_filters/windows_filter_tests.rs
Align network and I/O filter tests with updated StdlibConfig APIs and capability-scoped workspaces while trimming duplicated caching cases.
  • Refactor NetworkPolicy transform helpers to be pure functions returning NetworkPolicy directly and update callers to handle fallible allow/block operations via closures.
  • Remove the fetch cache behaviour test that relied on hash-based cache paths inside a workspace; cache semantics are covered elsewhere.
  • Update network and IO tests to use normalize_fluent_isolates for error message assertions and to rely on StdlibConfig::from_current_dir or StdlibConfig::new(workspace).with_workspace_root_path(...) as appropriate.
  • Ensure tests reset impurity state where relevant and use more precise ensure-based assertions with contextual messages.
tests/std_filter_tests/network_functions.rs
tests/std_filter_tests/io_filters.rs
Modernize collection and hash filter tests to use fluent-normalized error messages and improved diagnostics.
  • Replace direct string contains checks on raw error messages with normalize_fluent_isolates for flatten, group_by, and hash error paths.
  • Update hash filter tests to assert unknown algorithm errors via normalized messages and make legacy algorithm rejection messages more explicit.
  • Tighten collection filter tests to use ensure with contextual messages and avoid redundant env setup patterns.
tests/std_filter_tests/collection_filters.rs
tests/std_filter_tests/hash_filters.rs
Consolidate std_filter test support into a focused fallible module exporting only the workspace builder and internal helpers.
  • Trim the public re-exports from support.rs to only expose filter_workspace, keeping register_template/render/stdlib_env* within the fallible module for internal use.
  • Improve fallible helpers with more precise error contexts around template registration and rendering, and ensure workspace setup writes fixtures via cap-std Dir APIs.
  • Document that std_filter_tests command fixtures and ShellCase are owned by that integration-test target and that shared facilities should live in test_support instead.
tests/std_filter_tests/support.rs
docs/developers-guide.md

Possibly linked issues


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 August 4, 2026 18:10

@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 have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92c144b229

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/integration_test_wiring_tests.rs Outdated
@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from 92c144b to 7463a7e Compare August 4, 2026 20:18
codescene-access[bot]

This comment was marked as outdated.

@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from 7463a7e to 7d7e5f8 Compare August 4, 2026 20:39
codescene-access[bot]

This comment was marked as outdated.

@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from 7d7e5f8 to fc16b72 Compare August 4, 2026 22:46
codescene-access[bot]

This comment was marked as outdated.

@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from fc16b72 to d1d540a Compare August 5, 2026 10:29
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from 7d88b4b to 01abf53 Compare August 5, 2026 11:00
codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 5, 2026

Copy link
Copy Markdown
Owner

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

Base automatically changed from harden-lint-config to main August 5, 2026 22:18
@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from 01abf53 to 812597d Compare August 5, 2026 22:22
codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 5, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

src/stdlib/command/execution.rs

Comment on lines +103 to +113

    run_configured_command(
        SHELL,
        |cmd| {
            cmd.args(SHELL_ARGS).arg(command);
        },
        ChildInvocation {
            input,
            context,
            operation: CommandOperation::Shell,
        },
    )

❌ New issue: Code Duplication
The module contains 2 functions with similar structure: run_command,run_program

@leynos

leynos commented Aug 5, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

test_support/src/dev_fast/sandbox/utilities.rs

Comment on file

//! Host-utility discovery for the hermetic dev-fast sandbox.

❌ New issue: String Heavy Function Arguments
In this module, 64.3% of all arguments to its 10 functions are strings. The threshold for string arguments is 39.0%

@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from 4c03002 to 3e8ae45 Compare August 7, 2026 09:48
codescene-access[bot]

This comment was marked as outdated.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 7, 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.

coderabbitai[bot]

This comment was marked as resolved.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

leynos and others added 7 commits August 7, 2026 20:03
Restore the Cargo-discovered target for the dormant standard filter suite,
repair its compilation and behavioural drift, and isolate its filesystem
fixtures behind capabilities.

Remove the basic expanduser and fetch-cache cases duplicated by the stdlib
BDD scenarios. Remove first-match, all-match, missing-command, and workspace
fallback which cases duplicated by the BDD suite and stdlib_which_tests.

Add a regression guard that rejects tests/*/mod.rs trees without a matching
top-level Cargo integration-test source.
Require explicit path attributes to match an active source line instead of
accepting quoted path text anywhere in an integration-test source.

Cover a commented-out path attribute and module declaration so an orphaned
module tree cannot be mistaken for a Cargo target.
`which_filter_skips_heavy_directories` built its environment with
`fallible::stdlib_env_with_path`, which derives the resolver workspace from
`StdlibConfig::from_current_dir()`. The fixture's `target/helper` therefore sat
outside the searched workspace entirely, so the `not_found` assertion held
whether or not the skip policy existed. Renaming the fixture directory to a
name absent from `WORKSPACE_SKIP_DIRS` still passed, confirming the test
asserted nothing about the behaviour it named.

Build an explicit `StdlibConfig` rooted at the fixture workspace, matching the
wiring already used by `which_resolver_honours_workspace_root_override` and
`test_cwd_mode_resolution`, and pass the empty PATH through
`with_path_override`. The test now fails when the fixture directory is not on
the skip list and passes when it is.
Extract `assert_command_error_message` in the `stdlib::command::error` test
module so `spawn_errors_include_source` and `timeout_errors_report_duration`
share the `ErrorKind::InvalidOperation` and rendered-message assertions. Each
test keeps its own `CommandFailure` construction and localized expected
message, and both remain separate tests with unchanged coverage.

The helper takes `expected` by reference rather than by value: at `-D warnings`
`clippy::needless_pass_by_value` rejects the owned `String`, and consuming it
in place pushed the module past Whitaker's 400-line `module-max-lines` cap.

Also add `only_unwired_module_trees_are_reported`, a proptest over generated
module-tree names and every declaration form (active `mod`, active `#[path]`,
commented variants of both, and absent). `orphaned_module_trees` asserts a
universal invariant that the three fixed fixtures only sampled. The property
test discriminates where they do not: dropping the `line.trim()` call leaves
all three fixtures passing but fails the property test, because none of the
fixtures indents a declaration.
The four `with_suffix` tests each opened with the same
`fallible::filter_workspace()?` line. Extract it into an rstest `#[fixture]`
returning `Result<Workspace>` and inject it, propagating setup failures with
`?` at the use site. This matches the idiom already used by
`network_functions.rs` in the same test binary, where `http_policy` is a
fallible fixture consumed as `Result<NetworkPolicy>`.

rstest invokes a non-`#[once]` fixture per test case, so each test still owns
a distinct `TempDir`; running the four under a single process confirms four
distinct workspace roots. Test names, assertions, and coverage are unchanged.
The split-build-dir paragraph read "the `#[once]` `test_support_rlib` fixture
builds concurrently in the other test; sharing a target directory between the
two races on the uplifted rlibs and fails", which left "races" and "fails"
without a clear subject and implied a single peer test.

The fixture is shared by two tests, `stub_env_default_does_not_compile` and
`stub_env_builders_compile_under_the_same_harness`, so "the other test" was
also inaccurate. Name all three participants and split the clause into two
complete sentences, so the reader can see which test races which build.
`orphaned_module_trees` matched only a bare `mod <name>;`, so a tree declared
`pub mod <name>;` or `pub(crate) mod <name>;` was reported as orphaned even
though Cargo compiles it. Match all three forms alongside the existing
`#[path = "<name>/mod.rs"]` attribute.

Matching stays on whole trimmed lines, so indentation is still tolerated and a
commented-out declaration still leaves the tree orphaned; a prefix or substring
test would lose the latter.

Extend the generated `Declaration` model with `PubConventional` and
`PubCrateConventional`, both marked as wiring and rendered as valid Rust, so
the property test exercises them. Add
`visibility_qualified_declarations_wire_module_trees`, a case-based test
pinning each active form as wiring and each commented form as orphaned.

Reverting the matcher to the bare form fails exactly the `pub mod` and
`pub(crate) mod` cases plus the property test, and leaves the commented cases
passing.
@lodyai
lodyai Bot force-pushed the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch from df6ffe4 to dd0fa39 Compare August 7, 2026 19:27
codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 7, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Have the following now been resolved?

docs/developers-guide.md (1)

1915-1918: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Rewrite the target-directory sentence.
At Line 1916, the sentence makes “sharing a target directory” appear to both

“race” and “fail”. Name the two tests and use a complete sentence.

Proposed wording
-`#[once]` `test_support_rlib` fixture builds concurrently in the other test;
-sharing a target directory between the two races on the uplifted rlibs and
-fails with version-skew errors (`E0460`).
+`#[once]` `test_support_rlib` fixture builds concurrently in the other test.
+Sharing a target directory makes the two tests race on the uplifted rlibs and
+causes version-skew errors (`E0460`).

Triage: [type:grammar]
As per path instructions, Markdown grammar comments must include a Triage:

paragraph with [type:grammar].

🤖 Detailed instructions

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/developers-guide.md around lines 1915 - 1918, Rewrite the sentence in
the test_support_rlib documentation to explicitly name the two tests and use
complete grammar: state that the #[once] fixture builds concurrently in the
other test, then state that sharing a target directory makes the tests race on
uplifted rlibs and causes E0460 version-skew errors.

Source: Path instructions

@coderabbitai

coderabbitai Bot commented Aug 7, 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 -euo pipefail

printf '%s\n' '== Current revision =='
git rev-parse --short HEAD

printf '%s\n' '== Reported documentation range =='
sed -n '1890,1940p' docs/developers-guide.md | nl -ba -v1890

printf '%s\n' '== Fixture references in the guide =='
rg -n -C 5 '\btest_support_rlib\b|target directory|uplifted rlibs|E0460' docs/developers-guide.md

printf '%s\n' '== Referenced test identifiers =='
rg -n -C 4 '\btest_support_rlib\b' . -g '*.rs' -g '*.md' -g '*.toml'

Length of output: 921


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Current revision =='
git rev-parse --short HEAD

printf '%s\n' '== Reported documentation range =='
sed -n '1890,1940p' docs/developers-guide.md

printf '%s\n' '== Fixture references in the guide =='
rg -n -C 5 '\btest_support_rlib\b|target directory|uplifted rlibs|E0460' docs/developers-guide.md || true

printf '%s\n' '== Referenced test identifiers =='
rg -n -C 4 '\btest_support_rlib\b' . -g '*.rs' -g '*.md' -g '*.toml' || true

Length of output: 12086


@leynos

Mark this finding as resolved.

At revision dd0fa39, docs/developers-guide.md names all affected tests:

  • harness_compiles_under_a_split_build_dir
  • stub_env_default_does_not_compile
  • stub_env_builders_compile_under_the_same_harness

The current text uses complete sentences. It states that the #[once] test_support_rlib fixture builds concurrently for the two UI tests. It then states that a shared target directory makes harness_compiles_under_a_split_build_dir race that fixture build on uplifted rlibs and fail with E0460.

tests/locale_stub_ui_tests.rs confirms that both named UI tests use test_support_rlib.

No further change, AI-agent prompt, or follow-up issue is required.

Triage: [type:grammar]

You are interacting with an AI system.

@leynos

leynos commented Aug 7, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please investigate the cause of the following issue using codegraph exploration and research, identify a fix and provide an AI coding agent prompt for the fix:

          FAIL [   0.010s] (1576/1803) netsuke-build::std_filter_tests hash_filters::hash_filter_legacy_algorithms_disabled
    stdout ───
  
      running 1 test
      test hash_filters::hash_filter_legacy_algorithms_disabled ... FAILED
  
      failures:
  
      failures:
          hash_filters::hash_filter_legacy_algorithms_disabled
  
      test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 61 filtered out; finished in 0.01s
      
    stderr ───
      Error: error should mention legacy feature: invalid operation: Unsupported hash algorithm '⁨sha1⁩' (enable feature '⁨legacy-digests⁩'). (in hash_sha1:1)
  
      Stack backtrace:
         0: <anyhow::Error>::msg::<alloc::string::String>
         1: __covrec_70D437A96706A6A4
         2: __covrec_5D62D28B4026213Cu
         3: __covrec_A107D7120631EF9B
         4: __covrec_EF514A4952117D6E
         5: <std_filter_tests::hash_filters::hash_filter_legacy_algorithms_disabled::{closure#0} as core::ops::function::FnOnce<()>>::call_once
         6: test::__rust_begin_short_backtrace::<core::result::Result<(), alloc::string::String>, fn() -> core::result::Result<(), alloc::string::String>>
         7: test::run_test::{closure#0}
         8: std::sys::backtrace::__rust_begin_short_backtrace::<test::run_test::{closure#1}, ()>
         9: <std::thread::lifecycle::spawn_unchecked<test::run_test::{closure#1}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        10: <std::sys::thread::unix::Thread>::new::thread_start
        11: <unknown>
        12: <unknown>
  
    Cancelling due to test failure: 3 tests still running
          PASS [   4.489s] (1577/1803) netsuke-build::release_help_script_tests release_help::script_functions::manual_date_matches_utc_calendar_date_for_i32_epoch_range
          PASS [  79.668s] (1578/1803) netsuke-build::packaging_smoke_tests packaged_manifest_retains_build_script_sources
          PASS [  10.011s] (1579/1803) netsuke-build::std_filter_tests command_filters::shell_filter_tests::shell_filter_times_out_long_commands
  ────────────
       Summary [ 130.845s] 1579/1803 tests run: 1578 passed (4 slow), 1 failed, 1 skipped
          FAIL [   0.010s] (1576/1803) netsuke-build::std_filter_tests hash_filters::hash_filter_legacy_algorithms_disabled
  warning: 224/1803 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
  error: test run failed
  error: process didn't exit successfully: `/home/runner/.rustup/toolchains/nightly-2026-06-25-x86_64-unknown-linux-gnu/bin/cargo nextest run --manifest-path Cargo.toml --target-dir /home/runner/work/netsuke/netsuke/target/llvm-cov-target --workspace` (exit status: 100)
  cargo llvm-cov nextest --manifest-path Cargo.toml --workspace --lcov --output-path lcov.info failed with code 1
  Error: Process completed with exit code 1.

@coderabbitai

This comment was marked as resolved.

`hash_filter_legacy_algorithms_disabled` matched the raw rendered diagnostic
against "enable feature 'legacy-digests'". Fluent wraps string placeables in
U+2068 FSI and U+2069 PDI, so the rendered message reads

    Unsupported hash algorithm '<FSI>sha1<PDI>' (enable feature
    '<FSI>legacy-digests<PDI>').

and the plain substring test failed even though the diagnostic was correct.

Wrap the error in `normalize_fluent_isolates` before the `contains` check, as
the sibling assertions in this file already do for the unsupported-algorithm
message. The expected text and the error-kind assertion are unchanged, so the
check is no weaker: substituting a wrong feature name still fails it.

The test is gated `#[cfg(not(feature = "legacy-digests"))]`, so the
`--all-features` gates compile it out and never caught this. Validated under
default features, where the whole target passes 62/62, as well as under
`--all-features` at 65/65.
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

The existing guards read declaration text out of the sources, so they can only
police what the sources say. A manifest-level mistake leaves every source
untouched and slips past all of them.

Add `cargo_discovers_every_top_level_integration_test_source`, which runs
`cargo metadata --no-deps` through `env!("CARGO")` and asserts that the set of
discovered integration-test targets equals the set of top-level `tests/*.rs`
files, in both directions. A missing entry is a source Cargo never compiles; an
extra one is a target resolving outside `tests/`, which would invalidate the
sibling guards' path assumptions.

Restoring `autotests = false` with a partial `[[test]]` list fails the new test
and names all 65 undiscovered sources, so it discriminates on the case it
exists for. It costs about 20ms: `cargo metadata` neither builds nor uses the
network.

It does not catch #520 itself. A tree carrying its own `mod.rs` and no
top-level source contributes to neither set, leaving the equality intact;
`module_trees_are_wired_to_cargo_test_targets` still owns that direction, as a
faithful replay of the #520 layout confirms. The doc comment records the split
so neither guard is mistaken for covering the other.
codescene-access[bot]

This comment was marked as outdated.

@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 quality gates enabled for this code.

@leynos
leynos merged commit 5685929 into main Aug 7, 2026
17 checks passed
@leynos
leynos deleted the issue-520-tests-std-filter-tests-has-not-been-compiled-since-october-2025 branch August 7, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests/std_filter_tests/ has not been compiled since October 2025

3 participants