Skip to content

feat: fixes and tests - #36

Merged
troels-im merged 33 commits into
mainfrom
feature/minor-fixes
Jan 17, 2026
Merged

troels-im merged 33 commits into
mainfrom
feature/minor-fixes

Conversation

@troels-im

Copy link
Copy Markdown
Contributor

No description provided.

Troels F. Rønnow added 30 commits January 16, 2026 20:55
Added comprehensive tests for:
- webfetch.rs: HTML conversion, tool methods, args deserialization
- read.rs: file reading, sensitive file detection, similar file suggestions
- grep.rs: pattern matching, glob helpers, tool methods
- todo.rs: todo stores, status/priority enums, tool methods
- glob.rs: build_find_command, tool methods, path handling
- bash.rs: tool methods, command execution, background mode
- multiedit.rs: fuzzy matching, indentation matching, diff generation
- lib.rs: ToolContext methods, ToolOutput, ToolEvent

Coverage improvements:
- wonopcode-tools: 60.58% -> 90.18%

7 crates now at ≥90% coverage:
- wonopcode-auth: 90.06%
- wonopcode-protocol: 93.29%
- wonopcode-snapshot: 95.40%
- wonopcode-storage: 97.81%
- wonopcode-test-utils: 90.82%
- wonopcode-tools: 90.18%
- wonopcode-util: 91.43%
- Added 37 tests to bus.rs (now 99.56% coverage)
- Added 25 tests to version.rs (now 98.19% coverage)
- Added 28 tests to format.rs (now 94.77% coverage)
- Added 19 tests to project.rs (now 96.90% coverage)
- Added 29 tests to command.rs (now 98.39% coverage)
- Added 25 tests to agent.rs testing AgentMode, AgentPermission,
  AgentRegistry, custom agents, and sandbox config
- Added 12 tests to server.rs for ServerConfig, ServerState
- Added 18 tests to serve.rs for McpToolContext, PendingPermissions,
  McpServerToolBuilder, and ClosureExecutor
wonopcode-discover:
- Added 33 tests for service.rs (ServerInfo, AdvertiseConfig)
- Added tests for error.rs (DiscoverError display/debug)
- Added tests for advertise.rs (Advertiser state management)
- Added tests for browse.rs (Browser, ServerInfo operations)
- Coverage improved from 9% to 59%

wonopcode-server:
- Added 6 tests for state.rs (SharedTodoStore operations)
- Added 18 tests for ws.rs (ClientMessage, ServerMessage serde)
- Coverage improved from 20% to 32%
Added tests for:
- headless.rs: Tests for all request types (PromptRequest, ModelRequest, AgentRequest,
  SessionSwitchRequest, SessionRenameRequest, SessionForkRequest, RevertRequest,
  McpToggleRequest, McpReconnectRequest, GotoRequest, SettingsRequest,
  PermissionRequest, GitUnstageRequest)
- prompt.rs: Additional tests for PromptEvent::Status, PromptUsage, new_session_runners,
  AgentConfig clone, and model info variants (o1, o3-mini, gemini-pro, gpt-4o, claude-opus)
- routes.rs: Tests for ApiError helper methods (not_found, bad_request, internal),
  default_replay_limit, generate_id

Test count increased from 147 to 180 tests.
Current coverage:
- wonopcode-discover: 65.59%
- wonopcode-server: ~38%

Note: Reaching 90% coverage requires integration tests for HTTP handlers.
- Add tests for AgentConfig, capitalize_provider in agent.rs
- Add tests for ProcessorConfig, get_model_info, load_api_key in processor.rs
- Add tests for AgentMode, Theme, RenderSettings in theme.rs
- Add tests for Event, EventHandler, is_quit, is_escape, etc. in event.rs

Coverage improvements:
- wonopcode-tui-core: 39.72% → 61.98%
- wonopcode-acp: 38.46% → 47.26%
- Total: 52.80% → 53.69%
Supports sorting by:
- crate: alphabetical by crate name (default)
- lines: by total lines (descending)
- covered: by covered lines (descending)
- coverage: by coverage percentage (descending)
- status: by status (worst first: 🔴 → 🟠 → 🟡 → ✅)

Usage: just covstats --sort coverage
       just covstats --sort=status
       just covstats --help
@troels-im
troels-im added this pull request to the merge queue Jan 17, 2026
Merged via the queue into main with commit f84fbf3 Jan 17, 2026
13 checks passed
@troels-im
troels-im deleted the feature/minor-fixes branch January 17, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant