Skip to content

Expand openhuman.test_reset coverage as more domains are touched by E2E #147

@ElioNeto

Description

@ElioNeto

Issue imported from tinyhumansai/openhuman#1862
Created at: unknown


Summary

openhuman.test_reset (added in tinyhumansai#1859) currently wipes only what cron-jobs-flow.spec.ts needs: auth marker, api_key, chat_onboarding_completed, and cron jobs. Other domains carry over state across the in-place reset, which will silently contaminate later specs in the same Appium session.

Problem

The test_reset RPC is the contract that the single-Appium-session model rests on: every spec calls resetApp(<userId>) which calls this RPC, and downstream tests trust it to produce a pristine workspace. Today it lies about that — only four domain stores get cleared.

Domains known to persist state through test_reset today:

  • memory — vector store, KV docs, knowledge graph
  • memory_tree — chunks + summary tree + sync state (already has wipe_all_rpc to reuse)
  • channels — channel definitions, web channel connections
  • skills — discovered SKILL.md installs
  • webview_accounts — provider account markers
  • threads — conversation thread + message history
  • notifications — integration notification queue
  • webhooks — tunnel registrations + capture log
  • cost — token usage history
  • referral — apply state
  • composio — synced connections, triggers

Each batch in tinyhumansai#1860 that touches a new domain will need that domain's wipe wired in.

Solution

  1. Define a WipeHook trait in src/openhuman/test_support/ so each domain owns its own wipe and test_reset_rpc just iterates registered hooks.
  2. Register one hook per domain in the domain's mod.rs (mirrors the controller-registration pattern from AGENTS.md). Reuses existing wipe_all_rpc / clear_all_jobs where they exist.
  3. Each new domain hook returns an entry in the ResetSummary so test logs make it obvious what was actually wiped.
  4. Add a regression test in tests/json_rpc_e2e.rs that seeds each known domain, runs test_reset, and asserts the seeds are gone.

Acceptance criteria

  • Hook trait + registrytest_support/registry.rs (or similar) defines the trait and the iteration loop.
  • Domain wipes wired — memory, memory_tree, channels, skills, webview_accounts, threads, notifications, webhooks, cost, referral, composio.
  • ResetSummary extended — each hook reports a row count in the returned struct so spec logs are auditable.
  • Rust E2E testtests/json_rpc_e2e.rs covers the wipe contract for every registered hook.
  • Diff coverage ≥ 80% — covered by the new Rust E2E test.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions