Skip to content

test: audit cleanup — remove duplicates, useless tests, add critical coverage#1895

Merged
bug-ops merged 2 commits intomainfrom
test-audit-cleanup
Mar 16, 2026
Merged

test: audit cleanup — remove duplicates, useless tests, add critical coverage#1895
bug-ops merged 2 commits intomainfrom
test-audit-cleanup

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 15, 2026

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)

  • 7 is_private_ip_* in zeph-mcp/client.rs — source of truth: zeph-tools/net.rs
  • 4 cosine_similarity_* in zeph-skills/matcher.rs — source of truth: zeph-memory/math.rs
  • 4 strip_format_chars_* in zeph-mcp/sanitize.rs — source of truth: zeph-tools/patterns.rs
  • 1 content_hash_same_input_same_hash in zeph-mcp/registry.rs

Priority 2 — Remove useless tests (12 tests)

  • 3 #[derive(Debug)] output tests with no behavioral assertions
  • 2 hardcoded const/UUID equality tests (impossible to fail)
  • 2 config default tests with no assertions on values
  • 2 stdlib Vec::windows tests disguised as doom-loop tests
  • 1 no-op builder test (with_suppress_stderr)
  • 1 redundant non-empty check implied by sibling test
  • 1 tautological assertion (assert_eq!(x, x)) fixed to assert!(x)

Priority 3 — Add critical missing coverage (5 tests)

  • ContextAssembler: clear_history retains system prompt
  • ContextAssembler: clear_history idempotency with no history
  • ContextAssembler: empty skill list does not crash
  • ContextAssembler: cache marker count ≤ 4 (Claude API hard limit)
  • Agent loop: real doom-loop detection via MockProvider with identical outputs

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --workspace --features full -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins (5978 passed)

@github-actions github-actions bot added llm zeph-llm crate (Ollama, Claude) skills zeph-skills crate rust Rust code changes core zeph-core crate tests Test-related changes size/L Large PR (201-500 lines) labels Mar 15, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 15, 2026 23:35
@bug-ops bug-ops disabled auto-merge March 15, 2026 23:35
@github-actions github-actions bot added tests Test-related changes and removed tests Test-related changes labels Mar 15, 2026
@bug-ops bug-ops changed the title test: remove duplicate and useless tests test: audit cleanup — remove duplicates, useless tests, add critical coverage Mar 15, 2026
@github-actions github-actions bot added tests Test-related changes and removed tests Test-related changes labels Mar 15, 2026
bug-ops added 2 commits March 16, 2026 00:58
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
@bug-ops bug-ops force-pushed the test-audit-cleanup branch from be0fb58 to c63beb5 Compare March 15, 2026 23:58
@bug-ops bug-ops enabled auto-merge (squash) March 15, 2026 23:58
@github-actions github-actions bot removed the tests Test-related changes label Mar 15, 2026
@bug-ops bug-ops merged commit 632cf33 into main Mar 16, 2026
20 checks passed
@bug-ops bug-ops deleted the test-audit-cleanup branch March 16, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate llm zeph-llm crate (Ollama, Claude) rust Rust code changes size/L Large PR (201-500 lines) skills zeph-skills crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant