Summary
`Rust Core Coverage (cargo-llvm-cov)` has been failing on every PR-CI run (and on `main` itself) since PR #3023 (commit `5345f2a8`) merged on 2026-05-30. The two failing tests both live in the new `tests/inference_local_admin_raw_coverage_e2e.rs` file added by that PR. There is no open issue tracking it as of filing.
Sample failing runs:
Failure A — missing PATH isolation
`local_admin_reports_unhealthy_runtime_and_lm_studio_issue_shapes` (tests/inference_local_admin_raw_coverage_e2e.rs:466) asserts `!assets.ollama_available` at line 485. Unlike the sibling test at line 270 which sets up `EnvVarGuard::set("PATH", scripts.path())` + an `exit 42` stub, this test does no `PATH` isolation. On CI runners that have `ollama` somewhere on the system PATH (or an `OLLAMA_BIN` set), `assets.ollama_available` returns `true` → assertion fails.
Fix shape: add `let _path = EnvVarGuard::set("PATH", tempdir.path());` + `EnvVarGuard::unset("OLLAMA_BIN")` to mirror the sibling test.
Failure B — parallel-test env-var race
`local_admin_covers_assets_diagnostics_downloads_and_ops_errors` (line 253) calls `service.download_asset(&config, "chat")` at line 330, which panics at line 332 with `"ollama tags request failed: error sending request for url (http://localhost:11434/api/tags)"\`. The test correctly sets `OPENHUMAN_OLLAMA_BASE_URL` via `EnvVarGuard::set` at line 282, but the actual `/api/tags` call hits the hardcoded default.
Root cause: `LocalAiService::has_model()` (src/openhuman/inference/local/service/ollama_admin.rs:1403) delegates to `has_model_at(&ollama_base_url(), …)`. Three tests in this same binary mutate `OPENHUMAN_OLLAMA_BASE_URL` concurrently (lines 282, 440, 472). Cargo runs them in parallel and `EnvVarGuard` does not serialize — one test's guard scope ends or is overwritten before another reads the env var.
Fix shape (two options):
- Serialize the env-mutating tests with `serial_test::serial` or a module-level `OnceLock<Mutex<()>>`, or
- Refactor `has_model()` to take a `&Config` and call the config-aware `ollama_base_url_from_config()` resolver so the test's `config.local_ai.base_url` short-circuits the env lookup. (Cleaner; removes a hidden global dependency.)
Impact
Every PR opened after 2026-05-30 has been red on this gate. PR authors (including me on PR #3034) have been routing around it. Filing because nobody else has — happy to take a fix as a follow-up; opening a partial PR for Failure A shortly.
Summary
`Rust Core Coverage (cargo-llvm-cov)` has been failing on every PR-CI run (and on `main` itself) since PR #3023 (commit `5345f2a8`) merged on 2026-05-30. The two failing tests both live in the new `tests/inference_local_admin_raw_coverage_e2e.rs` file added by that PR. There is no open issue tracking it as of filing.
Sample failing runs:
Failure A — missing PATH isolation
`local_admin_reports_unhealthy_runtime_and_lm_studio_issue_shapes` (tests/inference_local_admin_raw_coverage_e2e.rs:466) asserts `!assets.ollama_available` at line 485. Unlike the sibling test at line 270 which sets up `EnvVarGuard::set("PATH", scripts.path())` + an `exit 42` stub, this test does no `PATH` isolation. On CI runners that have `ollama` somewhere on the system PATH (or an `OLLAMA_BIN` set), `assets.ollama_available` returns `true` → assertion fails.
Fix shape: add `let _path = EnvVarGuard::set("PATH", tempdir.path());` + `EnvVarGuard::unset("OLLAMA_BIN")` to mirror the sibling test.
Failure B — parallel-test env-var race
`local_admin_covers_assets_diagnostics_downloads_and_ops_errors` (line 253) calls `service.download_asset(&config, "chat")` at line 330, which panics at line 332 with `"ollama tags request failed: error sending request for url (http://localhost:11434/api/tags)"\`. The test correctly sets `OPENHUMAN_OLLAMA_BASE_URL` via `EnvVarGuard::set` at line 282, but the actual `/api/tags` call hits the hardcoded default.
Root cause: `LocalAiService::has_model()` (src/openhuman/inference/local/service/ollama_admin.rs:1403) delegates to `has_model_at(&ollama_base_url(), …)`. Three tests in this same binary mutate `OPENHUMAN_OLLAMA_BASE_URL` concurrently (lines 282, 440, 472). Cargo runs them in parallel and `EnvVarGuard` does not serialize — one test's guard scope ends or is overwritten before another reads the env var.
Fix shape (two options):
Impact
Every PR opened after 2026-05-30 has been red on this gate. PR authors (including me on PR #3034) have been routing around it. Filing because nobody else has — happy to take a fix as a follow-up; opening a partial PR for Failure A shortly.