test: improve coverage for security-critical and core modules#680
Merged
test: improve coverage for security-critical and core modules#680
Conversation
Add 23 new tests across 11 files targeting security-critical code, zero-coverage modules, and core functionality gaps: - trust_commands: 6 integration tests for skill trust management - retry: 3 mock HTTP server tests + proptest for delay bounds - pipeline: 2 unit tests for IngestionPipeline - redact: 3 proptests (panic safety, path sanitization, non-secret preservation) - vault: 3 proptests (SecretValue round-trip, debug/display redaction) - embedding_store: 5 unit tests with InMemoryVectorStore - line_editor: 14 unit tests for internal text manipulation - filter: 2 proptests (FilterPipeline + OutputFilterRegistry panic safety) - matcher: 2 proptests (ScoredMatch round-trip, cosine_similarity bounds) - e2e: config TOML to agent single-loop integration test Security module coverage: redact 99%, vault 99%, audit 98%, permissions 100%, filter/security 100%, trust_commands 46% (was 4%).
Add 36 unit tests for previously under-tested modules: - persistence.rs: 5 tests for load_history/persist paths - utils.rs: 8 tests for token estimation, context injection - mcp.rs: 8 tests for subcommand dispatch without manager - any.rs: 8 tests for AnyChannel::Cli variant delegation - router.rs: 6 tests for SubProvider delegation and status_tx
Add 28 tests covering remaining gaps: - tool_execution.rs: 11 tests for redaction, tool result handling, sandbox violations, and exit code paths - learning.rs: 9 tests for skill command dispatch edge cases - Snapshot tests (insta): config default serialization, git diff/status filter output, cargo build/error filter, clippy grouped warnings - Add insta as dev-dep to zeph-core and zeph-tools
a676236 to
99a880c
Compare
Update dev dependencies: - proptest 1.6 -> 1.10 - insta 1.46 -> 1.46.3 Remove unused dependencies detected by cargo-machete: - root: tokio-util, sqlx (not used in binary crate) - zeph-llm, zeph-memory, zeph-skills: anyhow (replaced by typed errors) - zeph-memory: tokio-stream - zeph-a2a: tokio-util - zeph-index: tokio-stream Add insta snapshot files for config, filter output tests.
Initialize variables with correct values directly instead of assigning and then overwriting, fixing -D warnings CI failure.
The any_channel_cli_confirm_returns_bool test calls dialoguer::Confirm which blocks waiting for stdin input, causing hangs on Windows CI.
b206cf8 to
fcae43f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
cargo +nightly fmt --checkpassescargo clippy --workspace -- -D warningspassescargo nextest run --workspace --lib --bins— 2076 passed, 0 failed, 9 skipped