Skip to content

fix: cargo clippy --all-targets fails without feature=testing (zeph_llm::mock unavailable in integration tests) #3648

@bug-ops

Description

@bug-ops

Description

cargo clippy --all-targets --features full -- -D warnings fails with 40 compilation errors across 4 integration test targets. The root cause is that integration tests in tests/ import zeph_llm::mock::MockProvider and use AnyProvider::Mock(...) without the testing feature being enabled.

AnyProvider::Mock is gated behind #[cfg(any(test, feature = "testing"))] in crates/zeph-llm/src/any.rs:99. Integration test files compiled via --all-targets are not inside a #[cfg(test)] block, so the Mock variant is invisible unless --features testing is also passed.

Reproduction Steps

  1. cargo clippy --all-targets --features full -- -D warnings
  2. Observe: 40 errors
error[E0432]: unresolved import `zeph_llm::mock`          (10×)
error[E0433]: cannot find `mock` in `zeph_llm`            (3×)
error[E0599]: no variant or associated item named `Mock`  (27×)

Failing targets:

  • zeph (test "orchestration_integration") — 1 error
  • zeph (test "performance_agent_integration") — 4 errors
  • zeph (test "integration") — 21 errors
  • zeph (bin "zeph" test) — 14 errors

Expected Behavior

cargo clippy --all-targets --features full compiles cleanly.

Actual Behavior

40 errors due to zeph_llm::mock and AnyProvider::Mock being unavailable without feature = "testing".

Fix Options

Option A (preferred): Add testing to the full feature bundle in Cargo.toml:

full = ["desktop", "ide", "server", "chat", "pdf", "scheduler", "classifiers", "profiling", "task-metrics", "sandbox", "self-check", "gonka", "testing"]

This makes integration test compilation consistent and is the simplest fix.

Option B: Add #[cfg(feature = "testing")] guards around all integration test files in tests/ that import zeph_llm::mock.

Option A is preferred — adding testing to full is already the logical composition for comprehensive builds.

Environment

  • Version: v0.20.1 (HEAD 02a6f35)
  • Features: --features full (without testing)
  • Observed: CI-701 static analysis, 2026-05-06

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't workingllmzeph-llm crate (Ollama, Claude)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions