test: add CLI ↔ daemon end-to-end tests #153

Closed
opened 2026-04-27 05:35:05 +00:00 by xiaoju · 0 comments
Owner

Problem

Current test suite has a gap between CLI unit tests (mocked daemon) and daemon integration tests (no CLI entry point). Bugs like signal persistence (#150) slip through because each layer passes independently but the cross-layer contract is never verified.

Proposed Scope

Sense

  • nerve sense list — shows registered senses with correct last signal timestamp
  • nerve sense query — returns rows after daemon produces signals
  • nerve sense trigger — triggers compute and signal appears in query

Workflow

  • nerve workflow runs — lists runs after a real workflow completes
  • nerve workflow inspect — shows correct status and log entries
  • nerve workflow thread — displays role conversation

Daemon lifecycle

  • nerve daemon start / stop — clean startup and shutdown

Approach

  • Spawn a real daemon in a temp HOME with a minimal nerve.yaml (e.g. a trivial counter sense)
  • Wait for readiness via IPC socket or health check
  • Run CLI commands via runCommand() or subprocess
  • Assert stdout / exit codes
  • Tear down daemon + temp dir

Ref

Motivated by #150 — sense query returned 0 rows despite signals being emitted.

## Problem Current test suite has a gap between CLI unit tests (mocked daemon) and daemon integration tests (no CLI entry point). Bugs like signal persistence (#150) slip through because each layer passes independently but the cross-layer contract is never verified. ## Proposed Scope ### Sense - nerve sense list — shows registered senses with correct last signal timestamp - nerve sense query <name> — returns rows after daemon produces signals - nerve sense trigger <name> — triggers compute and signal appears in query ### Workflow - nerve workflow runs — lists runs after a real workflow completes - nerve workflow inspect <runId> — shows correct status and log entries - nerve workflow thread <runId> — displays role conversation ### Daemon lifecycle - nerve daemon start / stop — clean startup and shutdown ## Approach - Spawn a real daemon in a temp HOME with a minimal nerve.yaml (e.g. a trivial counter sense) - Wait for readiness via IPC socket or health check - Run CLI commands via runCommand() or subprocess - Assert stdout / exit codes - Tear down daemon + temp dir ## Ref Motivated by #150 — sense query returned 0 rows despite signals being emitted.
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#153