Skip to content

test: coverage sprint — 65 new tests across 16 files - #185

Merged
leocamello merged 1 commit into
mainfrom
024-test-coverage-sprint
Feb 18, 2026
Merged

leocamello merged 1 commit into
mainfrom
024-test-coverage-sprint

Conversation

@leocamello

Copy link
Copy Markdown
Owner

Summary

Add 65 new unit tests across all 16 files with below-80% coverage to reach the 90% overall coverage target.

Test Breakdown

Category Files New Tests
Agent streaming anthropic, generic, google, lmstudio, ollama, openai 12
Agent embeddings ollama, openai 4
Agent quality quality.rs 2
API handlers completions.rs 10
API embeddings embeddings.rs 5
CLI backends backends.rs 4
CLI serve serve.rs 6
Dashboard handler.rs, websocket.rs 7
Discovery mod.rs 8
Metrics handler.rs 3
Queue mod.rs 2
Total 16 files 65 tests

Coverage Areas

  • Streaming: All 6 agent types now have chat_completion_stream tests (success + error)
  • Embeddings: Ollama + OpenAI agent embeddings() method coverage
  • API handlers: Priority extraction, budget header injection, error chunks, request recording
  • CLI: Backend type auto-detection, config override propagation
  • Dashboard: HTTP handlers, WebSocket update creation
  • Discovery: IP selection, URL building, instance name extraction
  • Metrics: Handler endpoints, budget stats computation
  • Queue: Config access, priority dequeue ordering

Test Results

  • All 878 tests pass (up from 813)
  • Clippy clean (-D warnings)
  • Formatting verified

Agent modules (21 tests):
- anthropic, generic, google, lmstudio, ollama, openai: chat_completion_stream tests
- ollama, openai: embeddings() tests
- quality: config() and reconciliation_loop tests

API handlers (15 tests):
- completions: extract_priority, inject_budget_headers, create_error_chunk,
  available_models, record_request_completion tests
- embeddings: serialization, deserialization, encoding_format tests

CLI (10 tests):
- backends: detect_backend_type for ollama, llamacpp, generic, unknown
- serve: config override tests for port, host, discovery, health, log_level

Dashboard (7 tests):
- handler: dashboard_handler, history_handler, assets_handler
- websocket: empty backends, model change, request complete, serialization

Infrastructure (12 tests):
- discovery: select_best_ip, build_url (IPv4/IPv6/path), extract_name_from_instance
- metrics: budget_stats, stats_handler, metrics_handler
- queue: config access, priority ordering
@leocamello leocamello added the testing Testing related label Feb 18, 2026
@leocamello
leocamello merged commit c608e7b into main Feb 18, 2026
9 checks passed
@leocamello
leocamello deleted the 024-test-coverage-sprint branch February 18, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant