test: audit cleanup — remove duplicates, useless tests, add critical coverage#1895
Merged
test: audit cleanup — remove duplicates, useless tests, add critical coverage#1895
Conversation
Remove 26 test functions identified in the test audit: - 7 is_private_ip_* duplicates from zeph-mcp (source of truth: zeph-tools) - 4 cosine_similarity duplicates from zeph-skills (source of truth: zeph-memory) - 4 strip_format_chars duplicates from zeph-mcp (source of truth: zeph-tools) - 1 content_hash duplicate in zeph-mcp/registry - 4 useless tests in zeph-mcp/registry (const equality, UUID non-nil, Debug impls) - 2 useless tests in zeph-mcp/manager (Debug impl, no-op builder check) - 4 useless tests in zeph-core/agent (no assertions, stdlib behavior tests) - 1 redundant test in zeph-tools/patterns Fix tautological assertion in zeph-llm/orchestrator/router.
Add 5 tests for critical paths identified in the test audit: - ContextAssembler: clear_history retains system prompt - ContextAssembler: clear_history idempotency with no history - ContextAssembler: empty skill list does not crash - ContextAssembler: cache marker count stays within Claude API limit (<=4) - Agent loop: real doom-loop detection via MockProvider with identical outputs
be0fb58 to
c63beb5
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
Full test audit cleanup based on static analysis of all ~5032 tests across the workspace.
Net change: −26 tests removed, +5 tests added
Priority 1 — Remove duplicates (16 tests)
is_private_ip_*inzeph-mcp/client.rs— source of truth:zeph-tools/net.rscosine_similarity_*inzeph-skills/matcher.rs— source of truth:zeph-memory/math.rsstrip_format_chars_*inzeph-mcp/sanitize.rs— source of truth:zeph-tools/patterns.rscontent_hash_same_input_same_hashinzeph-mcp/registry.rsPriority 2 — Remove useless tests (12 tests)
#[derive(Debug)]output tests with no behavioral assertionsVec::windowstests disguised as doom-loop testswith_suppress_stderr)assert_eq!(x, x)) fixed toassert!(x)Priority 3 — Add critical missing coverage (5 tests)
ContextAssembler:clear_historyretains system promptContextAssembler:clear_historyidempotency with no historyContextAssembler: empty skill list does not crashContextAssembler: cache marker count ≤ 4 (Claude API hard limit)MockProviderwith identical outputsTest plan
cargo +nightly fmt --checkcargo clippy --workspace --features full -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins(5978 passed)