Skip to content

Test Coverage

Test Coverage Analysis

This document provides an exhaustive analysis of test coverage across all Clauderon platforms and components.

Test Inventory Summary

PlatformTest FilesTest FunctionsCoverage Level
Rust Backend24 integration + many unit~500+Comprehensive
Rust TUI1 (54KB)79Good
Web Frontend6~130+Partial (logic only)
Mobile121Minimal

Rust Tests - Detailed Breakdown

TUI Tests (79 tests in tests/tui_tests.rs)

State Transition Tests (11)

TestPurpose
test_app_initial_stateInitial app mode
test_select_next_empty_listEmpty list navigation
test_select_next_boundaryBoundary navigation forward
test_select_previous_boundaryBoundary navigation backward
test_open_create_dialogDialog opening
test_close_create_dialogDialog closing
test_open_delete_confirmDelete confirmation opening
test_cancel_deleteDelete cancellation
test_create_dialog_focus_cycleTab cycling through fields
test_toggle_helpHelp mode toggle
test_quitQuit mode toggle

Event Handler Tests (20)

TestPurpose
test_ctrl_c_quitsCtrl+C quit shortcut
test_session_list_q_quitsQ key quit
test_session_list_n_opens_dialogN key opens dialog
test_session_list_question_mark_opens_help? key opens help
test_session_list_navigationArrow key navigation
test_create_dialog_tab_navigationTab navigation
test_create_dialog_backtab_navigationBackTab navigation
test_create_dialog_text_inputText input handling
test_create_dialog_backspaceBackspace handling
test_create_dialog_escape_closesEscape closes dialog
test_create_dialog_toggle_backendBackend toggle
test_create_dialog_toggle_skip_checksCheckbox toggle
test_create_dialog_space_in_prompt_fieldSpace in prompt
test_create_dialog_space_in_prompt_field_multiwordMulti-word prompt
test_create_dialog_space_in_repo_path_fieldDirectory picker trigger
test_confirm_delete_y_confirmsY confirms delete
test_confirm_delete_n_cancelsN cancels delete
test_confirm_delete_escape_cancelsEscape cancels delete
test_help_escape_closesEscape closes help
test_help_q_closesQ closes help

Rendering Tests (6)

TestPurpose
test_render_empty_session_listEmpty list rendering
test_render_session_list_with_sessionsPopulated list rendering
test_render_connection_errorError state rendering
test_render_create_dialogDialog rendering
test_render_create_dialog_with_loadingLoading indicator
test_render_helpHelp overlay rendering

API Integration Tests (14)

TestPurpose
test_refresh_sessions_updates_listSession refresh
test_refresh_sessions_handles_errorRefresh error handling
test_create_session_successSession creation
test_create_session_shows_loading_indicatorLoading during create
test_create_session_failureCreate failure handling
test_delete_session_successSession deletion
test_delete_error_handlingDelete error handling
test_deletion_state_trackingDeletion state tracking
test_delete_blocked_during_createBlocking during create
test_create_blocked_during_deleteBlocking during delete
test_archive_selected_successArchive operation
test_reconcile_successReconciliation
test_attach_command_returns_commandAttach command generation
test_selected_index_clamped_after_refreshIndex clamping

Directory Picker Tests (8)

TestPurpose
test_directory_picker_opens_and_closesLifecycle
test_directory_picker_close_with_escEscape closing
test_directory_picker_navigationNavigation
test_directory_picker_navigation_keysKey bindings
test_directory_picker_searchSearch functionality
test_directory_picker_search_filteringSearch filtering
test_directory_picker_open_with_enterSelection
test_render_directory_picker_without_panicRendering

Signal Menu Tests (8)

TestPurpose
test_signal_menu_state_newState creation
test_signal_menu_state_defaultDefault state
test_signal_menu_select_nextNext selection
test_signal_menu_select_previousPrevious selection
test_signal_menu_selected_signalSignal retrieval
test_open_signal_menuMenu opening
test_close_signal_menuMenu closing
test_render_signal_menu_without_panicRendering

Kubernetes UI Tests (12)

TestPurpose
test_k8s_specific_fields_initializedField initialization
test_toggle_pull_policyPull policy toggle
test_pull_policy_toggle_with_keyboardKeyboard toggle
test_dangerous_copy_creds_toggleCopy creds toggle
test_dangerous_copy_creds_toggle_with_keyboardKeyboard toggle
test_k8s_navigation_with_k8s_backendNavigation with K8s
test_k8s_navigation_skipped_without_k8s_backendConditional navigation
test_container_image_text_inputImage text input
test_storage_class_text_inputStorage class input
test_k8s_session_creation_passes_optionsSession creation
test_k8s_backend_available_with_feature_flagFeature flag
test_render_create_dialog_with_k8s_backendK8s dialog rendering

TUI Not Tested

  • Mouse interactions
  • Window resize handling
  • Scroll behavior in long lists
  • Unicode/special character input
  • Cursor positioning verification
  • Visual layout/colors verification
  • Performance/stress testing
  • Copy mode
  • Locked mode
  • Session switching (Ctrl+P/N)
  • External editor (Ctrl+E)

Backend Tests - Docker (46 tests)

Unit Tests in src/backends/docker.rs (32)

Build Arguments:

TestPurpose
test_create_uses_dit_not_dUses -dit for interactive TTY
test_create_runs_as_non_rootUses —user flag
test_initial_workdir_subdirectoryWorkdir subdirectory handling
test_initial_workdir_emptyEmpty workdir handling
test_container_name_prefixedclauderon- prefix
test_attach_uses_bash_not_zshBash wrapper
test_attach_starts_stopped_containerRestart before attach
test_print_mode_adds_flagsPrint mode flags
test_interactive_mode_no_print_flagInteractive mode flags

Security:

TestPurpose
test_sanitize_git_config_removes_newlinesNewline injection prevention
test_sanitize_git_config_removes_control_charsControl char removal
test_sanitize_git_config_preserves_tabsSafe tab preservation
test_sanitize_git_config_preserves_normal_charsNormal char preservation
test_prompt_escapingQuote escaping

Caching:

TestPurpose
test_rust_caching_configuredCargo/sccache volumes

Proxy:

TestPurpose
test_proxy_config_adds_env_varsHTTPS_PROXY, SSL_CERT_FILE
test_proxy_config_adds_volume_mountsCA cert mounting
test_no_proxy_configNo env vars without proxy
test_host_docker_internal_always_added—add-host flag

Git Worktree:

TestPurpose
test_git_worktree_mounts_parent_gitParent .git mount
test_non_worktree_no_extra_mountsNo extra mounts
test_git_worktree_relative_pathRelative path handling
test_git_worktree_trailing_whitespaceTrailing whitespace
test_malformed_git_file_graceful_failureGraceful failure
test_missing_parent_git_graceful_failureMissing parent handling

Uploads & History:

TestPurpose
test_uploads_directory_mountedUploads mount
test_image_path_translationPath translation
test_session_history_project_path_with_subdirectorySubdirectory paths
test_session_history_project_path_at_rootRoot paths

Dangerous Mode:

TestPurpose
test_dangerous_skip_checks_without_proxySkip checks flag
test_claude_json_without_dangerous_skip_checksClaude.json handling

E2E Tests in tests/e2e_docker.rs (5, all IGNORED)

TestPurpose
test_docker_container_lifecycleFull create→verify→logs→delete
test_docker_container_exists_checkExistence check
test_docker_attach_commandAttach command generation
test_docker_delete_nonexistentDelete non-existent
test_docker_is_running_checkRunning check

Integration Tests in tests/integration_lifecycle.rs (4, all IGNORED)

TestPurpose
test_docker_full_lifecycle_with_attachCreate→attach→detach→re-attach→delete
test_worktree_and_container_togetherGit + Docker integration
test_container_output_retrievalget_output()
test_reattach_stopped_containerReattach stopped

Smoke Tests in tests/smoke_tests.rs (5, all IGNORED)

TestPurpose
test_claude_starts_in_dockerClaude startup
test_claude_writes_debug_files.claude writable
test_container_runs_as_non_rootUID verification
test_initial_prompt_executedPrompt delivery
test_claude_print_mode_e2eFull OAuth proxy E2E

Docker Not Tested

  • CPU/memory limit enforcement
  • Volume lifecycle management
  • Network configuration beyond proxy
  • Multi-container orchestration
  • Crash detection/recovery

Backend Tests - Kubernetes (6 tests)

Unit Tests in src/backends/kubernetes.rs (2)

TestPurpose
test_pod_name_generationPod naming
test_attach_command_formatkubectl attach format

E2E Tests in tests/e2e_kubernetes.rs (4, 3 IGNORED)

TestPurposeStatus
test_kubernetes_pod_lifecyclePod lifecycleIGNORED
test_kubernetes_pod_exists_checkExistence checkIGNORED
test_kubernetes_attach_commandAttach commandActive
test_kubernetes_delete_nonexistentDelete non-existentIGNORED

Kubernetes Not Tested

  • PVC creation and management
  • Namespace configuration
  • RBAC/ServiceAccount setup
  • Resource quotas
  • Storage class selection
  • Pod logs streaming
  • CrashLoopBackOff handling
  • Multi-repo support

Backend Tests - Zellij (15 tests)

Unit Tests in src/backends/zellij.rs (11)

TestPurpose
test_create_uses_background_flagBackground mode
test_new_pane_has_cwdPane working directory
test_new_pane_uses_actionAction usage
test_new_pane_uses_bashBash shell
test_new_pane_has_separatorSeparator handling
test_prompt_escapingQuote escaping
test_attach_command_formatAttach format
test_command_includes_dangerous_flagSkip permissions
test_command_includes_imagesImage handling
test_image_path_escapingPath escaping
test_command_with_no_imagesNo images case

E2E Tests in tests/e2e_zellij.rs (4, 3 IGNORED)

TestPurposeStatus
test_zellij_session_lifecycleSession lifecycleIGNORED
test_zellij_session_exists_checkExistence checkIGNORED
test_zellij_attach_commandAttach commandActive
test_zellij_delete_nonexistentDelete non-existentIGNORED

Zellij Not Tested

  • Session layout configuration
  • Window/pane management
  • Scrollback buffers
  • Codex agent support

Backend Tests - Sprites (30 tests)

Unit Tests in src/backends/sprites.rs (4)

TestPurpose
test_sprite_name_from_sessionSprite naming
test_attach_commandConsole command
test_with_configConfig application
test_default_backendDefault config

E2E Tests in tests/e2e_sprites.rs (26, all IGNORED)

Core Lifecycle:

TestPurpose
test_sprites_lifecycleFull lifecycle
test_sprites_exists_checkExistence check
test_sprites_attach_commandAttach command
test_sprites_is_remoteRemote detection
test_sprites_delete_nonexistentDelete non-existent

PTY:

TestPurpose
test_sprites_pty_attachmentFull PTY flow
test_sprites_pty_resizeTerminal resize

Repository:

TestPurpose
test_sprites_multi_repo_sessionMulti-repo
test_sprites_new_branch_creationNew branch
test_sprites_existing_remote_branch_trackingBranch tracking
test_sprites_base_branch_workflowBase branch

Clone:

TestPurpose
test_sprites_shallow_clone_enabledShallow clone on
test_sprites_shallow_clone_disabledShallow clone off

Installation:

TestPurpose
test_sprites_claude_installation_verifiedClaude installed
test_sprites_abduco_installation_verifiedAbduco installed

Output:

TestPurpose
test_sprites_agent_produces_outputOutput production
test_sprites_get_output_returns_log_contentLog retrieval
test_sprites_get_output_empty_when_no_logEmpty log handling

Errors:

TestPurpose
test_sprites_invalid_git_remote_failsInvalid remote
test_sprites_missing_remote_failsMissing remote

Lifecycle Config:

TestPurpose
test_sprites_auto_destroy_false_persistsPersist on
test_sprites_auto_destroy_true_destroysAuto-destroy

Edge Cases:

TestPurpose
test_sprites_parallel_creationConcurrency
test_sprites_special_characters_in_promptSpecial chars
test_sprites_empty_initial_promptEmpty prompt

Sprites Not Tested

  • Checkpoint functionality
  • Wake from hibernation
  • Model override
  • Plan mode
  • Build caching

Backend Tests - Apple Container (0 tests)


Health & Reconciliation Tests (67 tests)

Health Check Logic in tests/e2e_health.rs (28)

  • ResourceState testing (Healthy, Stopped, Hibernated, Pending, Missing, Error, CrashLoop, DataLost, WorktreeMissing)
  • Backend-specific health actions (Docker, K8s, Zellij, Sprites)
  • Data safety per backend
  • Startup health detection

API Serialization in tests/api_health_tests.rs (29)

  • ResourceState serialization (11 states)
  • AvailableAction serialization
  • SessionHealthReport serialization
  • HealthCheckResult serialization

Reconciliation in tests/e2e_reconcile.rs (5)

  • Worktree detection/cleanup
  • Docker container cleanup detection
  • Stale session handling
  • Healthy session verification

Backend Utilities in tests/backend_tests.rs (5)

  • GitBackend instantiation
  • Path generation utilities

API Endpoint Test Coverage

EndpointMethodTestedNotes
/api/sessionsGETUnit tests on SessionManager
/api/sessionsPOSTUnit tests on SessionManager
/api/sessions/{id}GETUnit tests
/api/sessions/{id}DELETEUnit tests
/api/sessions/{id}/archivePOSTUnit tests
/api/sessions/{id}/unarchivePOSTUnit tests
/api/sessions/{id}/refreshPOSTNo tests
/api/sessions/{id}/startPOST⚠️Indirect via health
/api/sessions/{id}/wakePOST⚠️Indirect via health
/api/sessions/{id}/recreatePOST⚠️Indirect via health
/api/sessions/{id}/cleanupPOST⚠️Indirect via health
/api/sessions/{id}/metadataPOSTUnit tests
/api/sessions/{id}/regenerate-metadataPOST⚠️Serialization only
/api/sessions/{id}/access-modePOSTNo tests
/api/sessions/{id}/historyGETNo tests
/api/sessions/{id}/uploadPOSTNo tests
/api/healthGETComprehensive
/api/sessions/{id}/healthGETComprehensive
/api/recent-reposGETUnit tests
/api/browse-directoryPOSTNo tests
/api/credentialsPOSTNo tests
/api/statusGETNo tests
/api/storage-classesGETNo tests
/api/feature-flagsGETNo tests
/api/hooksPOSTNo tests
/api/auth/**⚠️Logic tested, not HTTP
/ws/console/{id}WSNo tests
/ws/eventsWSNo tests

Web Frontend Tests

Test Files (6 files, ~130+ tests)

FileTestsCoverage
RecreateConfirmModal.test.tsx21State display, action details, data safety by backend
RecreateBlockedModal.test.tsx13Blocked detection, backend-specific blocking
ThemeToggle.test.tsx13localStorage, system preferences, persistence
StartupHealthModal.test.tsx8Health labels, colors, filtering
claudeParser.test.ts30+ANSI stripping, code blocks, file paths, tools, messages
codexHistoryParser.test.ts20+Format detection, message parsing, function calls

Web Not Tested

  • React component rendering (DOM output)
  • User interactions (clicks, form submission)
  • API calls / fetch mocking
  • Hooks (useSession, useWebSocket, etc.)
  • Terminal component (xterm.js)
  • Form validation
  • WebSocket connections
  • Navigation/routing

Mobile Tests

Test Files (1 file, 21 tests)

FileTestsCoverage
historyParser.test.ts21Message parsing, tool use/result matching

Mobile Not Tested (Critical Gaps)


Feature → Test Matrix

Session Management

FeatureRust BackendTUIWebMobile
List sessions
Create session
Delete session
Archive/Unarchive
Edit metadataN/A
Status filtering
Health status
Workflow stage
PR status
Auto-refresh

Terminal/Console

FeatureRust BackendTUIWebMobile
PTY creationN/A
WebSocket streaming
Scrollback bufferN/A
Terminal resize✅ (Sprites)N/A
Signal menuN/AN/AN/A
Locked modeN/AN/AN/A

Chat Interface

FeatureRust BackendTUIWebMobile
Message parsingN/A
Claude formatN/A
Codex formatN/A
Tool use displayN/A
Image upload

Backend Operations

OperationDockerK8sZellijSpritesApple
CREATE✅✅✅✅✅✅✅
ATTACH✅✅✅✅
DELETE
EXISTS
GET_OUTPUT⚠️
HEALTH

Priority Gaps

P0 - Critical (Blocking Quality)

GapPlatformImpact
Apple Container: 0 testsRustmacOS backend completely untested
Mobile: No component testsMobileAll UI untested
Mobile: No API client testsMobileAll API calls untested
WebSocket endpoints: 0 testsRustReal-time features untested
No HTTP integration testsRustOnly unit tests, no E2E

P1 - High Priority

GapPlatformImpact
K8s: Only 2 unit testsRustMinimal K8s coverage
Web: No component renderingWebReact components untested
Web: No hook testsWebState management untested
Mobile: No WebSocket testsMobileConsole/events untested
PR/Workflow featuresAllCompletely untested

P2 - Medium Priority

GapPlatformImpact
TUI: No mouse testsRustMouse interactions untested
TUI: No resize testsRustWindow resize untested
Web: No terminal testsWebxterm.js untested
API: access-mode endpointRustNo tests
API: upload endpointRustNo tests

P3 - Lower Priority

GapPlatformImpact
TUI: No copy mode testsRustText selection untested
TUI: No locked mode testsRustLocked mode untested
Docker: No volume lifecycleRustVolume mgmt untested
K8s: No PVC testsRustStorage untested

Running Tests

Rust

Terminal window
# All tests
cargo test
# With nextest (faster parallel)
cargo nextest run
# Specific test file
cargo test --test tui_tests
# With output
cargo test -- --nocapture

Web

Terminal window
cd web && bun test

Mobile

Terminal window
cd mobile && bun test