Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing Guide

Comprehensive test coverage for OpenCrabs. All tests run with:

cargo test --all-features

Quick Reference

CategoryTestsLocation
Tests — CLI Parsing28src/tests/cli_test.rs
Tests — Cron Jobs & Scheduling49src/tests/cron_test.rs
Tests — Channel Search24src/tests/channel_search_test.rs
Tests — Voice STT Dispatch11src/tests/voice_stt_dispatch_test.rs
Tests — Voice Onboarding62src/tests/voice_onboarding_test.rs
Tests — Candle Whisper6src/tests/candle_whisper_test.rs
Tests — Evolve (Self-Update)23src/tests/evolve_test.rs
Tests — Session & Working Dir15src/tests/session_working_dir_test.rs
Tests — Message Compaction24src/tests/compaction_test.rs
Tests — Fallback Vision35src/tests/fallback_vision_test.rs
Tests — GitHub Copilot Provider38src/tests/github_provider_test.rs
Tests — File Extract36src/tests/file_extract_test.rs
Tests — Image Utils9src/tests/image_util_test.rs
Tests — Onboarding Brain21src/tests/onboarding_brain_test.rs
Tests — Onboarding Navigation26src/tests/onboarding_navigation_test.rs
Tests — Onboarding Types16src/tests/onboarding_types_test.rs
Tests — Onboarding Keys4src/tests/onboarding_keys_test.rs
Tests — OpenAI Provider16src/tests/openai_provider_test.rs
Tests — Plan Document15src/tests/plan_document_test.rs
Tests — TUI Error16src/tests/tui_error_test.rs
Tests — Queued Messages15src/tests/queued_message_test.rs
Tests — Custom Provider27src/tests/custom_provider_test.rs
Tests — Context Window14src/tests/context_window_test.rs
Tests — Onboarding Field Nav46src/tests/onboarding_field_nav_test.rs
Tests — Provider Sync10src/tests/provider_sync_test.rs
Tests — Brain Templates8src/tests/brain_templates_test.rs
Tests — Collapse Build Output9src/tests/collapse_build_output_test.rs
Tests — Reasoning Lines6src/tests/reasoning_lines_test.rs
Tests — AltGr Input8src/tests/altgr_input_test.rs
Tests — System Continuation6src/tests/system_continuation_test.rs
Tests — QR Render8src/tests/qr_render_test.rs
Tests — WhatsApp State7src/tests/whatsapp_state_test.rs
Tests — Post-Evolve5src/tests/post_evolve_test.rs
Tests — Stream Loop Detection15src/tests/stream_loop_test.rs
Tests — XML Tool Fallback10src/tests/xml_tool_fallback_test.rs
Tests — TUI Render Clear4src/tests/tui_render_clear_test.rs
Tests — Split Panes21src/tests/split_pane_test.rs
Tests — Slack Formatting21src/tests/slack_formatting_test.rs
Tests — Daemon Health10src/tests/daemon_health_test.rs
Tests — Claude CLI Cache5src/tests/claude_cli_cache_test.rs
Tests — Browser Headless4src/tests/browser_headless_test.rs
Tests — Provider Registry8src/tests/provider_registry_test.rs
Tests — Self-Healing System27src/tests/self_healing_test.rs
Tests — Emergency Compaction2src/tests/compaction_test.rs
Tests — Cross-Channel Crash Recovery12src/tests/pending_request_test.rs
Tests — Profile System57src/tests/profile_test.rs
Tests — Token Tracking29src/tests/token_tracking_test.rs
Tests — Cron Execution Storage6src/tests/cron_results_test.rs
Tests — LLM Artifact Stripping8src/tests/artifact_strip_test.rs
Tests — Subagent & Team Orchestration84src/tests/subagent_test.rs
Tests — Telegram Resume Pipeline55src/tests/telegram_resume_test.rs
Brain (all modules)365src/brain/
TUI (all modules)141src/tui/
Channels (all modules)105src/channels/
Utils (all modules)56src/utils/
Services (all modules)44src/services/
DB (all modules)40src/db/
Config (all modules)32src/config/
A2A (all modules)21src/a2a/
Usage17src/usage.rs
Pricing17src/pricing.rs
Memory9src/memory/
Logging4src/logging/
Total3,925

Feature-Gated Tests

Some tests only compile/run with specific feature flags:

FeatureTests
local-sttLocal whisper inline tests, candle whisper tests, STT dispatch local-mode tests, codec tests, availability cycling tests
local-ttsTTS voice cycling, Piper voice Up/Down

All feature-gated tests use #[cfg(feature = "...")] and are automatically included when running with --all-features.


Running Tests

# Run all tests (recommended)
cargo test --all-features

# Run a specific test module
cargo test --all-features -- voice_onboarding_test

# Run a single test
cargo test --all-features -- is_newer_major_bump

# Run with output (for debugging)
cargo test --all-features -- --nocapture

# Run only local-stt tests
cargo test --features local-stt -- local_whisper

Disabled Test Modules

These modules exist but are commented out in src/tests/mod.rs (require network or external services):

ModuleReason
error_scenarios_testRequires mock API server
integration_testEnd-to-end with LLM provider
plan_mode_integration_testEnd-to-end plan workflow
streaming_testRequires streaming API endpoint