Skip to content

chore: Expand and optimize comprehensive test coverage - #1053

Merged
ndizazzo merged 3 commits into
mainfrom
codex/test-all-comprehensive
Jul 22, 2026
Merged

chore: Expand and optimize comprehensive test coverage#1053
ndizazzo merged 3 commits into
mainfrom
codex/test-all-comprehensive

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make just test-all derive comprehensive Rust coverage from the workspace instead of a hand-maintained crate subset
  • separate incompatible native feature graphs while parallelizing independent frontend and portable-script lanes
  • remove redundant coverage and replace fixed waits, live-network dependencies, cache dependencies, and colliding temporary paths in slow or flaky tests
  • make Playwright self-contained with a managed Vite server, shared fixtures, updated assertions, and restored responsive coverage
  • generate CI crate-test batches from Cargo metadata so pull requests test affected crates plus reverse dependencies, while main and manual runs test all workspace crates
  • add repository-consistency checks that fail when any workspace crate is omitted or duplicated across CI batches

Why

The previous local and CI test paths both relied on curated crate lists. New workspace crates could therefore be added without ever entering either test path. Several tests also paid for real timeouts or external/cache state, and the browser suite was only partially exercising its intended coverage.

Results

Section Before After
Rust tests executed 2,544 4,322
Portable checks 55.60s 27.18s
Host-runtime focused tests 47.06s 23.67s
Playwright 2 passed / 1 skipped 19 passed / 1 skipped
Overall warm just test-all 218.14s 286.94s

The overall run is 68.80s longer because it now executes about 70% more Rust tests. Despite that coverage expansion, measured Rust-test throughput improved by about 29%, and the two largest focused sections above were reduced by roughly half.

CI behavior

  • pull requests: compute affected Rust crates and reverse dependencies, then distribute them deterministically across four independent test jobs
  • pushes to main and manual runs: distribute all 56 workspace crates across the same four jobs
  • each job runs its assigned Cargo commands serially to avoid artifact and package-cache lock conflicts
  • workflow validation executes the planner and asserts that every workspace crate appears exactly once

Validation

  • just test-all — passed
    • 4,322 Rust tests passed; 179 ignored
    • 953 Vitest tests passed; 3 skipped
    • 92 Python tests passed; 3 skipped
    • 9 Node console tests and 2 SDK tests passed
    • 19 Playwright tests passed; 1 skipped
  • actionlint .github/workflows/*.yml
  • bash -n scripts/plan-test-batches.sh scripts/affected-crates.sh
  • full planner coverage: 56 workspace crates across 4 batches, no omissions or duplicates
  • targeted planner coverage: 14 affected/reverse-dependent crates, no omissions or duplicates
  • cargo fmt --all --check
  • cargo check -p xtask
  • cargo clippy -p xtask --all-targets -- -D warnings
  • cargo test -p xtask — 4 passed
  • cargo run -p xtask -- repo-consistency ci-crate-lists
  • cargo run -p xtask -- repo-consistency release-targets
  • cargo run -p xtask -- repo-consistency publish-crates
  • git diff --check

Kotlin and Swift portable checks remain explicitly skipped on this machine because their required Java/XCFramework prerequisites are unavailable.

Summary by CodeRabbit

  • New Features

    • Added Q2_0 quantization support across parsing/FFI mappings and mmproj sidecar selection.
    • Added configurable owner control-plane connection timeout.
    • Linux builds now link OpenMP libraries automatically when enabled.
    • UI now sets an explicit MeshLLM page title.
  • Bug Fixes

    • Improved owner control-plane connection failure handling for faster, more deterministic shutdown.
  • Chores / CI

    • CI now runs Rust crate tests via deterministic batching using a generated rust_crate_tests matrix, with updated coverage validation.
    • Added a portable test runner and standardized Playwright E2E using shared fixtures; updated several UI assertions.

@coderabbitai

coderabbitai Bot commented Jul 22, 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
📝 Walkthrough

Walkthrough

This PR adds deterministic Rust crate-test batching and dedicated CI matrices, portable validation, Q2_0 and OpenMP support, control-plane and model-resolution changes, benchmark and sidecar tests, typed process termination, and shared Playwright fixtures and assertions.

Changes

CI test batching

Layer / File(s) Summary
Batch planning and routing
.github/actions/compute-changes/action.yml, scripts/plan-test-batches.sh, scripts/affected-crates.sh
Affected or full-workspace crates are deterministically grouped into JSON test batches and routed through CI outputs.
Dedicated crate-test jobs
.github/workflows/ci.yml, .github/workflows/pr_builds.yml
New rust_crate_tests matrices run cargo test -p for planned crates, while crate-test steps are removed from linux_test_groups.
Coverage invariants and documentation
tools/xtask/src/*, .github/AGENTS.md, ci/ci.md
Workflow checks validate batch coverage and consumption, and CI documentation describes the new routing contract.

Portable validation

Layer / File(s) Summary
Portable validation workflow
Justfile, scripts/test-portable.sh
Rust validation is split between dynamic and static targets; portable project and SDK checks run in parallel before Playwright E2E tests.

Quantization and native linking

Layer / File(s) Summary
Q2_0 type and FFI mappings
crates/llama-quant-ffi/src/lib.rs, crates/skippy-quantize/src/types.rs
Q2_0 is added across FFI values, tensor conversions, names, catalogs, parsing, and tests.
Linux OpenMP linking
crates/llama-quant-ffi/build.rs
Enabled OpenMP libraries are resolved from the CMake cache and linked on Linux.

Runtime behavior and test updates

Layer / File(s) Summary
Configurable control-plane bootstrap
crates/mesh-client/src/client/control_plane.rs, crates/mesh-client/tests/control_plane_client.rs
Control-plane connection timeouts are configurable, and failed endpoint closure is bounded.
Control listener integration coverage
crates/mesh-llm-host-runtime/src/mesh/tests/*
Tests cover listener startup, advertised addresses, ALPN, handshake timeout, endpoint visibility, and shutdown.
Injectable model catalog resolution
crates/mesh-llm-host-runtime/src/network/nostr/model_packs.rs
Model-pack and demand-seeding helpers accept injected catalog resolvers and deduplicate combined defaults.
mmproj sidecar resolution
crates/model-hf/src/store/local.rs, crates/model-hf/src/store/local/mmproj.rs
Sidecar discovery is modularized with quantization-aware and precision-ranked candidate selection.
Benchmark and process test coverage
crates/mesh-llm-system/src/benchmark*, crates/skippy-bench/*
Benchmark tests are extracted into a dedicated suite, and child termination uses typed signals with platform-specific handling.
Runtime test maintenance
crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs, crates/mesh-llm-host-runtime/src/network/openai/response/probe.rs
Test naming and Tokio timing configuration are updated.

UI E2E fixtures and assertions

Layer / File(s) Summary
Shared Playwright runtime
crates/mesh-llm-ui/e2e/fixtures/base.ts, crates/mesh-llm-ui/e2e/*, crates/mesh-llm-ui/playwright.config.ts, crates/mesh-llm-ui/index.html
Specs adopt shared fixtures, Playwright manages the Vite server, and the page receives an explicit title.
UI behavior assertions
crates/mesh-llm-ui/e2e/configuration/*, crates/mesh-llm-ui/e2e/smoke/*
Assertions use ARIA values, exact headings, stable responsive polling, broader fetch pass-through, and role-based request lookup.

Estimated code review effort: 5 (Critical) | ~100 minutes

Possibly related PRs

Suggested reviewers: i386, michaelneale

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.04% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: broader and more efficient test coverage across the repo.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/test-all-comprehensive

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.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@ndizazzo
ndizazzo force-pushed the codex/test-all-comprehensive branch from 255cd4e to 164eb52 Compare July 22, 2026 04:29
@ndizazzo
ndizazzo marked this pull request as ready for review July 22, 2026 04:30
@ndizazzo ndizazzo changed the title Expand and optimize comprehensive test coverage chore: Expand and optimize comprehensive test coverage Jul 22, 2026
@github-actions
github-actions Bot requested a review from i386 July 22, 2026 04:35

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr_builds.yml:
- Around line 427-432: Add a least-privilege permissions block to the
rust_crate_tests job, granting only contents: read, matching the existing ci.yml
rust_crate_tests configuration. Keep the job’s current conditions, matrix
settings, runner, and timeout unchanged.
- Line 444: Update the checkout step in the rust_crate_tests job to set
persist-credentials: false, matching the equivalent checkout configuration in
ci.yml. Keep the existing actions/checkout@v5 action unchanged.

In `@crates/model-hf/src/store/local.rs`:
- Around line 1240-1248: Split the oversized Rust files by extracting separable
responsibilities into named modules under 1,000 lines: in
crates/model-hf/src/store/local.rs, move mmproj resolution logic and its tests
around find_mmproj_path into a semantic module; in
crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs, move
listener-lifecycle tests into a semantic mesh test module; and in
crates/mesh-llm-system/src/benchmark.rs, move benchmark subprocess test support
into a named module. Update module declarations and visibility as needed while
preserving behavior and keeping each extracted module’s tests with its
implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 324ec3f1-febb-4357-90a4-3d92e0c12592

📥 Commits

Reviewing files that changed from the base of the PR and between c67c519 and 164eb52.

📒 Files selected for processing (32)
  • .github/AGENTS.md
  • .github/actions/compute-changes/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/pr_builds.yml
  • Justfile
  • ci/ci.md
  • crates/llama-quant-ffi/src/lib.rs
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-client/tests/control_plane_client.rs
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/network/nostr/model_packs.rs
  • crates/mesh-llm-host-runtime/src/network/openai/response/probe.rs
  • crates/mesh-llm-system/src/benchmark.rs
  • crates/mesh-llm-ui/e2e/a11y/home-a11y.spec.ts
  • crates/mesh-llm-ui/e2e/configuration/schema-controls.spec.ts
  • crates/mesh-llm-ui/e2e/fixtures/base.ts
  • crates/mesh-llm-ui/e2e/perf/meshviz-200.spec.ts
  • crates/mesh-llm-ui/e2e/plugins/web-ui-exemplar.live.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/chat-mobile.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/home.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/live-parity.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/topnav-responsive.spec.ts
  • crates/mesh-llm-ui/index.html
  • crates/mesh-llm-ui/playwright.config.ts
  • crates/model-hf/src/store/local.rs
  • crates/skippy-quantize/src/types.rs
  • scripts/affected-crates.sh
  • scripts/plan-test-batches.sh
  • scripts/test-portable.sh
  • tools/xtask/src/repo_consistency.rs
  • tools/xtask/src/workflow_checks.rs
💤 Files with no reviewable changes (1)
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs

Comment thread .github/workflows/pr_builds.yml
Comment thread .github/workflows/pr_builds.yml
Comment thread crates/model-hf/src/store/local.rs Outdated
@ndizazzo
ndizazzo force-pushed the codex/test-all-comprehensive branch from 164eb52 to 9ad8c02 Compare July 22, 2026 05:42

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
crates/mesh-llm-host-runtime/src/mesh/tests/control_listener.rs (1)

141-180: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use tempfile::TempDir for this test directory

This cleanup only runs at the end of the test, so any ? or panic leaves the directory behind. tempfile is already available in this crate, and switching to TempDir would make the cleanup automatic and let you drop the random-suffix bookkeeping.

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

In `@crates/mesh-llm-host-runtime/src/mesh/tests/control_listener.rs` around lines
141 - 180, Update the stalled-handshake test setup to use tempfile::TempDir
instead of a manually generated path and random suffix. Pass TempDir’s path to
start_owner_control_test_server, remove the explicit remove_dir_all cleanup, and
retain the existing test behavior while relying on TempDir’s automatic cleanup
on errors or panics.
crates/model-hf/src/store/local/mmproj.rs (1)

231-333: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unify these tests on tempfile::tempdir() for consistent cleanup.

mmproj_path_falls_back_to_single_sibling_sidecar and mmproj_path_ignores_ambiguous_sibling_sidecars already use tempfile::tempdir(), but these four still build timestamped dirs under std::env::temp_dir() with manual create_dir_all/remove_dir_all, which leaks artifacts on panic. Switching them to tempdir() aligns with the PR's temp-path handling and guarantees cleanup.

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

In `@crates/model-hf/src/store/local/mmproj.rs` around lines 231 - 333, Update the
four tests shown—mmproj_path_prefers_bf16_generic_precision_variants,
resolve_mmproj_path_prefers_explicit_override,
mmproj_path_prefers_quant_matched_named_candidate, and
mmproj_path_prefers_quant_matched_generic_sibling—to create their temporary
directories with tempfile::tempdir(). Use the returned directory path for test
files, remove manual create_dir_all and remove_dir_all calls, and retain the
existing assertions and test behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/llama-quant-ffi/build.rs`:
- Around line 346-354: Update the OpenMP library-name handling before the loop
to combine entries from both OpenMP_C_LIB_NAMES and OpenMP_CXX_LIB_NAMES instead
of using or_else. Preserve the existing empty-name and pthread filtering, then
pass every merged library to link_linux_lib_from_cache.

---

Nitpick comments:
In `@crates/mesh-llm-host-runtime/src/mesh/tests/control_listener.rs`:
- Around line 141-180: Update the stalled-handshake test setup to use
tempfile::TempDir instead of a manually generated path and random suffix. Pass
TempDir’s path to start_owner_control_test_server, remove the explicit
remove_dir_all cleanup, and retain the existing test behavior while relying on
TempDir’s automatic cleanup on errors or panics.

In `@crates/model-hf/src/store/local/mmproj.rs`:
- Around line 231-333: Update the four tests
shown—mmproj_path_prefers_bf16_generic_precision_variants,
resolve_mmproj_path_prefers_explicit_override,
mmproj_path_prefers_quant_matched_named_candidate, and
mmproj_path_prefers_quant_matched_generic_sibling—to create their temporary
directories with tempfile::tempdir(). Use the returned directory path for test
files, remove manual create_dir_all and remove_dir_all calls, and retain the
existing assertions and test behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ce3479ce-8ffb-4d2d-b18b-da31741921c7

📥 Commits

Reviewing files that changed from the base of the PR and between 164eb52 and 9ad8c02.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (39)
  • .github/AGENTS.md
  • .github/actions/compute-changes/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/pr_builds.yml
  • Justfile
  • ci/ci.md
  • crates/llama-quant-ffi/build.rs
  • crates/llama-quant-ffi/src/lib.rs
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-client/tests/control_plane_client.rs
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/control_listener.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/network/nostr/model_packs.rs
  • crates/mesh-llm-host-runtime/src/network/openai/response/probe.rs
  • crates/mesh-llm-system/src/benchmark.rs
  • crates/mesh-llm-system/src/benchmark/tests.rs
  • crates/mesh-llm-ui/e2e/a11y/home-a11y.spec.ts
  • crates/mesh-llm-ui/e2e/configuration/schema-controls.spec.ts
  • crates/mesh-llm-ui/e2e/fixtures/base.ts
  • crates/mesh-llm-ui/e2e/perf/meshviz-200.spec.ts
  • crates/mesh-llm-ui/e2e/plugins/web-ui-exemplar.live.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/chat-mobile.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/home.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/live-parity.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/topnav-responsive.spec.ts
  • crates/mesh-llm-ui/index.html
  • crates/mesh-llm-ui/playwright.config.ts
  • crates/model-hf/src/store/local.rs
  • crates/model-hf/src/store/local/mmproj.rs
  • crates/skippy-bench/Cargo.toml
  • crates/skippy-bench/src/evals.rs
  • crates/skippy-quantize/src/types.rs
  • scripts/affected-crates.sh
  • scripts/plan-test-batches.sh
  • scripts/test-portable.sh
  • tools/xtask/src/repo_consistency.rs
  • tools/xtask/src/workflow_checks.rs
💤 Files with no reviewable changes (2)
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
🚧 Files skipped from review as they are similar to previous changes (25)
  • crates/mesh-llm-ui/e2e/smoke/home.spec.ts
  • crates/mesh-llm-ui/index.html
  • .github/AGENTS.md
  • crates/mesh-llm-ui/e2e/fixtures/base.ts
  • crates/mesh-llm-host-runtime/src/network/openai/response/probe.rs
  • scripts/affected-crates.sh
  • crates/mesh-llm-ui/e2e/a11y/home-a11y.spec.ts
  • crates/mesh-client/tests/control_plane_client.rs
  • scripts/plan-test-batches.sh
  • .github/workflows/ci.yml
  • crates/mesh-llm-ui/e2e/configuration/schema-controls.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/topnav-responsive.spec.ts
  • Justfile
  • tools/xtask/src/repo_consistency.rs
  • scripts/test-portable.sh
  • crates/mesh-llm-ui/e2e/smoke/chat-mobile.spec.ts
  • crates/mesh-client/src/client/control_plane.rs
  • .github/workflows/pr_builds.yml
  • ci/ci.md
  • .github/actions/compute-changes/action.yml
  • crates/mesh-llm-ui/e2e/perf/meshviz-200.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/live-parity.spec.ts
  • crates/mesh-llm-ui/playwright.config.ts
  • tools/xtask/src/workflow_checks.rs
  • crates/mesh-llm-host-runtime/src/network/nostr/model_packs.rs

Comment thread crates/llama-quant-ffi/build.rs Outdated
@ndizazzo
ndizazzo force-pushed the codex/test-all-comprehensive branch from 9ad8c02 to c31ae01 Compare July 22, 2026 05:52
@ndizazzo
ndizazzo force-pushed the codex/test-all-comprehensive branch from c31ae01 to 1a1403c Compare July 22, 2026 06:17
@ndizazzo
ndizazzo force-pushed the codex/test-all-comprehensive branch from 1a1403c to b9abdf1 Compare July 22, 2026 15:26
@ndizazzo

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🧹 Nitpick comments (2)
crates/mesh-llm-system/src/benchmark/tests.rs (1)

52-59: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Env override isn't panic-safe.

f() here runs assertions that panic on failure (e.g., expect_err in the serial callers). On panic, remove_var never executes and BENCHMARK_CHILD_ENV leaks into subsequent tests. A drop guard keeps cleanup robust even when a test fails.

♻️ Optional: restore env via a drop guard
 fn with_benchmark_child_override<T>(path: &Path, f: impl FnOnce() -> T) -> T {
-    // TODO: Audit that the environment access only happens in single-threaded code.
-    unsafe { std::env::set_var(BENCHMARK_CHILD_ENV, path) };
-    let result = f();
-    // TODO: Audit that the environment access only happens in single-threaded code.
-    unsafe { std::env::remove_var(BENCHMARK_CHILD_ENV) };
-    result
+    struct Restore;
+    impl Drop for Restore {
+        fn drop(&mut self) {
+            // SAFETY: callers are #[serial]; single-threaded env access.
+            unsafe { std::env::remove_var(BENCHMARK_CHILD_ENV) };
+        }
+    }
+    // SAFETY: callers are #[serial]; single-threaded env access.
+    unsafe { std::env::set_var(BENCHMARK_CHILD_ENV, path) };
+    let _restore = Restore;
+    f()
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/mesh-llm-system/src/benchmark/tests.rs` around lines 52 - 59, Make
with_benchmark_child_override panic-safe by introducing a drop guard that
removes BENCHMARK_CHILD_ENV when unwound, while preserving the existing setup
before invoking f(). Ensure cleanup occurs on both normal return and panic, and
retain the current unsafe environment-access handling.
crates/model-hf/src/store/local/mmproj.rs (1)

231-333: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use tempfile::tempdir() for the remaining temp-dir tests too.

These four tests build the directory via std::env::temp_dir() + create_dir_all and only clean up on the success path — the remove_dir_all never runs if an assertion panics, leaking the directory. The sibling tests in this same file already use tempfile::tempdir(), which cleans up on Drop and avoids path collisions. Aligning them is a small, consistent hygiene win.

♻️ Example for one test
-        let temp = std::env::temp_dir().join(format!(
-            "mesh-llm-mmproj-precision-test-{}",
-            std::time::SystemTime::now()
-                .duration_since(std::time::UNIX_EPOCH)
-                .unwrap()
-                .as_nanos()
-        ));
-        std::fs::create_dir_all(&temp).unwrap();
-        let model = temp.join("Qwen3.5-0.8B-Q4_K_M.gguf");
+        let temp = tempfile::tempdir().unwrap();
+        let model = temp.path().join("Qwen3.5-0.8B-Q4_K_M.gguf");

Then drop the trailing let _ = std::fs::remove_dir_all(&temp);.

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

In `@crates/model-hf/src/store/local/mmproj.rs` around lines 231 - 333, Update the
four tests—mmproj_path_prefers_bf16_generic_precision_variants,
resolve_mmproj_path_prefers_explicit_override,
mmproj_path_prefers_quant_matched_named_candidate, and
mmproj_path_prefers_quant_matched_generic_sibling—to create temporary
directories with tempfile::tempdir(). Use the resulting directory path for test
files and remove the trailing manual remove_dir_all cleanup calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/mesh-llm-system/src/benchmark/tests.rs`:
- Line 322: Update the temporary path construction in the affected tests at the
fixed-name sites, including the fingerprint roundtrip test and the analogous
sites near the other referenced lines, to append a collision-resistant suffix
using std::process::id() and current nanoseconds, matching the existing pattern
in this file. Preserve each test’s filename purpose while ensuring concurrent
test-binary invocations use distinct paths.

In `@crates/mesh-llm-ui/e2e/smoke/topnav-responsive.spec.ts`:
- Around line 56-61: Update the polling predicate around readTopNavMetrics to
include the breakpoint-specific responsive control visibility expected after
setViewportSize, not just headerHeight, controlTopSpread, and
horizontalOverflow. Ensure polling completes only when the layout metrics and
visibility checks used later are simultaneously satisfied, so the subsequent
assertions in the top-nav smoke test are stable.

---

Nitpick comments:
In `@crates/mesh-llm-system/src/benchmark/tests.rs`:
- Around line 52-59: Make with_benchmark_child_override panic-safe by
introducing a drop guard that removes BENCHMARK_CHILD_ENV when unwound, while
preserving the existing setup before invoking f(). Ensure cleanup occurs on both
normal return and panic, and retain the current unsafe environment-access
handling.

In `@crates/model-hf/src/store/local/mmproj.rs`:
- Around line 231-333: Update the four
tests—mmproj_path_prefers_bf16_generic_precision_variants,
resolve_mmproj_path_prefers_explicit_override,
mmproj_path_prefers_quant_matched_named_candidate, and
mmproj_path_prefers_quant_matched_generic_sibling—to create temporary
directories with tempfile::tempdir(). Use the resulting directory path for test
files and remove the trailing manual remove_dir_all cleanup calls.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c2b3a284-94b8-4c7d-9104-a8a2493b637d

📥 Commits

Reviewing files that changed from the base of the PR and between 88f8b95 and b9abdf1.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (39)
  • .github/AGENTS.md
  • .github/actions/compute-changes/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/pr_builds.yml
  • Justfile
  • ci/ci.md
  • crates/llama-quant-ffi/build.rs
  • crates/llama-quant-ffi/src/lib.rs
  • crates/mesh-client/src/client/control_plane.rs
  • crates/mesh-client/tests/control_plane_client.rs
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/control_listener.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/mod.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs
  • crates/mesh-llm-host-runtime/src/network/nostr/model_packs.rs
  • crates/mesh-llm-host-runtime/src/network/openai/response/probe.rs
  • crates/mesh-llm-system/src/benchmark.rs
  • crates/mesh-llm-system/src/benchmark/tests.rs
  • crates/mesh-llm-ui/e2e/a11y/home-a11y.spec.ts
  • crates/mesh-llm-ui/e2e/configuration/schema-controls.spec.ts
  • crates/mesh-llm-ui/e2e/fixtures/base.ts
  • crates/mesh-llm-ui/e2e/perf/meshviz-200.spec.ts
  • crates/mesh-llm-ui/e2e/plugins/web-ui-exemplar.live.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/chat-mobile.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/home.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/live-parity.spec.ts
  • crates/mesh-llm-ui/e2e/smoke/topnav-responsive.spec.ts
  • crates/mesh-llm-ui/index.html
  • crates/mesh-llm-ui/playwright.config.ts
  • crates/model-hf/src/store/local.rs
  • crates/model-hf/src/store/local/mmproj.rs
  • crates/skippy-bench/Cargo.toml
  • crates/skippy-bench/src/evals.rs
  • crates/skippy-quantize/src/types.rs
  • scripts/affected-crates.sh
  • scripts/plan-test-batches.sh
  • scripts/test-portable.sh
  • tools/xtask/src/repo_consistency.rs
  • tools/xtask/src/workflow_checks.rs
💤 Files with no reviewable changes (2)
  • crates/mesh-llm-host-runtime/src/exact_test_wrappers.rs
  • crates/mesh-llm-host-runtime/src/mesh/tests/owner_control.rs

Comment thread crates/mesh-llm-system/src/benchmark/tests.rs Outdated
Comment thread crates/mesh-llm-ui/e2e/smoke/topnav-responsive.spec.ts
@ndizazzo
ndizazzo merged commit 5f341d6 into main Jul 22, 2026
30 checks passed
@ndizazzo
ndizazzo deleted the codex/test-all-comprehensive branch July 22, 2026 18:18
michaelneale added a commit that referenced this pull request Jul 23, 2026
* origin/main:
  chore: Expand and optimize comprehensive test coverage (#1053)

# Conflicts:
#	crates/llama-quant-ffi/build.rs
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.

1 participant