Skip to content

test: boost Rust coverage 43.6% → 68.0%, add 534 unit tests - #13

Merged
huichen merged 5 commits into
mainfrom
test/boost-coverage
Jul 22, 2026
Merged

huichen merged 5 commits into
mainfrom
test/boost-coverage

Conversation

@huichen

@huichen huichen commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds 534 new unit tests across all Rust and TypeScript components, boosting Rust line coverage from 43.6% to 68.0%.

Coverage improvements

Component Before After Δ
agent 43.56% 68.01% +24.5pp
channels 26.59% 33.37% +6.8pp
remote 8.78% 24.68% +15.9pp

Agent module coverage (selected)

Module Before After
config/mod.rs 0% 96.5%
events/mod.rs 3.6% 99.2%
types/mod.rs 34% 90.0%
models/future.rs 8% 93.6%
engine/mod.rs 0% 94.4%
session/mod.rs 48% 87.0%
rpc/commands.rs 0% 45.2%
rpc/session.rs 14% 69.8%
llm/mod.rs 12% 52.5%
agent/mod.rs 43% 62.3%

Test count changes

Component Before After Added
agent (Rust) 165 424 +259
channels (Rust) 50 126 +76
remote (Rust) 3 4 +1
TUI (TS) 108 160 +52
CLI (TS) 87 102 +15
GUI frontend (TS) 187 187 —
GUI backend (Rust) 123 123 —
Total 723 1,126 +403

Makefile

Added test-gui-rust target — GUI Rust backend tests were previously not triggered by make test.

Agent (165 → 424 tests, +259):
- config/mod.rs:      0% → 96.5%
- events/mod.rs:      3% → 99.2%
- types/mod.rs:      34% → 90.0%
- models/future.rs:   8% → 93.6%
- engine/mod.rs:      0% → 94.4%
- session/mod.rs:    48% → 87.0%
- llm/mod.rs:        12% → 52.5%
- rpc/session.rs:    14% → 69.8%
- rpc/commands.rs:    0% → 45.2%
- agent/mod.rs:      43% → 62.3% (PendingMessageQueue)
- sandbox/rules.rs:  96% → 97.4%

Channels (50 → 126 tests, +76):
- config.rs:          0% → 84.9%
- dingtalk/card.rs:   0% → 38.1%
- dingtalk/config.rs: 0% → 100%
- feishu/config.rs:   0% → 100%
- grpc_client.rs:     0% → 53.5% (parse_event)
- feishu_rest.rs:     0% → 23.6% (mime/base64)
- prompt_loop.rs:     0% → 19.1% (truncate/syntax)

Remote (3 → 4 tests, +1):
- config.rs:          0% → covered (env var handling)

TUI (108 → 160 tests, +52):
- SelectList + ScopedModelsSelector (34)
- Footer (18)

CLI (87 → 102 via npm test, +15 unit):
- mouse.ts, screenshot-writer.ts, ExecutionContextTracker (15)

Makefile: add test-gui-rust target (previously uncovered GUI Rust tests)
* chromium-endpoint.ts (identifyBrowser via resolveCdpEndpoint),
* chromium-execution-context.ts (ExecutionContextTracker).
*/
import { describe, test, expect, mock } from "bun:test";
@huichen
huichen requested a review from Copilot July 22, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@huichen
huichen merged commit 57a35bf into main Jul 22, 2026
11 checks passed
@huichen
huichen deleted the test/boost-coverage branch July 22, 2026 12:18
tallcode added a commit that referenced this pull request Jul 25, 2026
- Remove push: branches: [main] from ci.yml — branch protection's
  'Require branches to be up to date before merging' already forces
  the PR check to re-run on the merged result, making post-merge
  runs redundant.
- Bump pprof 0.13→0.15 to fix two Dependabot alerts (#12, #13)
  about unsound std::slice::from_raw_parts usage.

Co-authored-by: Claude Opus 4.8 <[email protected]>
huichen added a commit that referenced this pull request Aug 17, 2026
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.

2 participants