test: expand unit + e2e coverage from test-map (batch 2)#1752
Conversation
Adds ~115 Rust unit tests across 8 new files (~2,082 lines) and 3 new e2e scenarios in mega-flow.spec.ts. Targets high-priority coverage gaps from test-map.md spanning agent harness, accessibility, local-AI presets, credentials/account scoping, learning cache, meet agent, and WhatsApp data store + RPC. Unit (Rust): - agent/harness/harness_gap_tests.rs: tool_loop, dispatcher fallback parsing, tool-access boundary, context guard/timeout, follow-up resolution, silence timer, datetime grounding - accessibility/permissions_tests.rs: macOS poller state transitions, granted/denied detection, refresh - learning/prompt_sections_tests.rs: personalization cache facet ranking, capping, eviction - local_ai/presets_tests.rs: 5-tier RAM presets + vision-mode resolution - meet/ops_tests.rs: Meet URL normalization, host + name validation - meet_agent/ops_tests.rs: VAD lifecycle, sample-rate validation - whatsapp_data/schemas_tests.rs: agent-facing tool registry contract (ingest excluded) - whatsapp_data/store_tests.rs: account isolation, dedup, pruning - credentials/ops_tests.rs: per-account scoping + session isolation E2E (mega-flow.spec.ts): - Scenario 7: WhatsApp list_chats RPC contract - Scenario 10: account switch + isolation across reset cycles - Scenario 11: Composio enable_trigger -> webhook ingress roundtrip
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (18)
📝 WalkthroughWalkthroughThis PR extends test coverage across multiple Rust modules and the E2E test suite. Four new E2E scenarios exercise WhatsApp ingest/read flows, account switching, and Composio trigger/webhook roundtrips. Ten Rust subsystems (accessibility, agent harness, credentials, learning, local_ai, meet, meet_agent, whatsapp_data schemas/store) receive comprehensive unit test suites extracted into dedicated test files, improving code organization and coverage without modifying production APIs. ChangesTest Coverage Expansion and Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
Summary
test-map.md.mega-flow.spec.tswith 3 new e2e scenarios (WhatsApp tool, account isolation across resets, Composio webhook roundtrip).Problem
test-map.mdenumerates 1,220 synthesized features; many high-priority items have no direct unit-test coverage in core (agent harness loop guards, account scoping, WhatsApp data store, Meet URL handling, local-AI preset tiering, personalization cache, accessibility permission poller). This PR is batch 2 of an ongoing campaign (PR #1724 was batch 1) closing those gaps.Solution
Per-domain unit tests colocated as
*_tests.rssiblings, included via#[cfg(test)] #[path = "..."] mod ...;. Each new file targets narrow, deterministic behaviour — no network, no time flakes.Unit (Rust):
agent/harness/harness_gap_tests.rs— tool_loop, dispatcher fallback parsing (XML /<invoke>/ markdown fence), tool-access boundary, context guard + tool timeout, follow-up resolution, silence timer, datetime groundingaccessibility/permissions_tests.rs— macOS poller state transitions, granted/denied detection, refreshlearning/prompt_sections_tests.rs— personalization cache facet ranking, capping, evictionlocal_ai/presets_tests.rs— 5-tier RAM presets + vision-mode resolution per tiermeet/ops_tests.rs— Meet URL normalization, host + display-name validationmeet_agent/ops_tests.rs— VAD lifecycle, sample-rate validationwhatsapp_data/schemas_tests.rs— agent-facing tool registry contract (3 read-only tools;ingestexcluded)whatsapp_data/store_tests.rs— account isolation, dedup, pruningcredentials/ops_tests.rsextended — per-account scoping + session isolationE2E (
app/test/e2e/specs/mega-flow.spec.ts):list_chatsRPC contract (uses internalwhatsapp_data_ingestto seed)config_reset_local_datacyclesenable_trigger→ webhook ingress roundtripSubmission Checklist
docs/TEST-COVERAGE-MATRIX.md.Impact
cargo test --lib(sub-second per module locally) + 3 e2e scenarios to the mega-flow spec.Related
openhuman.agent_runRPC; mock LLM can't force nested tool calls deterministically), accessibility-permission e2e (noopenhuman.accessibility_*controllers registered yet). Will revisit once those RPC surfaces land.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
test/expand-coverage-from-test-map-batch1Validation Run
pnpm --filter openhuman-app format:check— auto-fix applied by pre-push hook onmega-flow.spec.ts, amended into the commit before pushpnpm typecheck— clean inapp/cargo test --lib whatsapp_data(33/33),local_ai(241/241),screen_intelligence(89/89),meet::ops(22/22),meet_agent::ops(24/24),credentials::ops(32/32),learning::prompt_sections(15/15),harness(284/284) — all greencargo fmtapplied;cargo check --testscleanValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
#[cfg(test)] moddeclarations that include the new sibling test files.Duplicate / Superseded PR Handling
Note: 2 pre-existing failures observed in
meet_agent::brain::testsandmeet_agent::rpc::testson main — not introduced by this PR. Flagged for follow-up.Summary by CodeRabbit