There were three answers to "how do I test against a daemon", and the CLI
— the thinnest client — had none, so its formatting and error handling
were exercised by compiling and forking the real binary plus tmux.
Adds crates/maestro-testing with a MockDaemon that serves the real /api/*
surface from maestro-protocol types, backed by a Vec<Session>. It replaces
two ad-hoc stubs: maestro-web's, which returned [{"id":"session-1"}] —
not a valid Session — and maestro-tui's scripted socket with a hardcoded
timeline.
maestro-cli gets its first tests against a daemon: six cases covering the
catalog, that DaemonInfo carries the version and presets its old private
copy dropped, that a structured failure surfaces the daemon's own message,
and that connection-refused stays distinguishable from an HTTP rejection.
maestro-web's proxy suite gains an end-to-end check that an upstream
rejection reaches the browser as a 4502 close carrying the daemon's
message — upstream_close_reason had only unit tests.
e2e keeps the tmux-shaped tests. cli_list_reads_from_daemon still runs the
shipped binary as a subprocess but now against MockDaemon, and
tui_integration.rs is deleted: the real daemon's /api/events contract is
covered by maestro-daemon/tests/local_api.rs and the client reducer by
maestro-tui/tests/catalog_ws.rs. The e2e suite drops from ~32s to ~20s.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
31 lines
795 B
TOML
31 lines
795 B
TOML
[package]
|
|
name = "maestro-e2e"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
description = "Cross-process integration tests: a real daemon as a subprocess"
|
|
|
|
[lib]
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
chrono.workspace = true
|
|
futures-util.workspace = true
|
|
maestro-protocol = { workspace = true, features = ["client"] }
|
|
maestro-testing.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
tempfile.workspace = true
|
|
thiserror.workspace = true
|
|
tokio.workspace = true
|
|
tokio-tungstenite.workspace = true
|
|
toml.workspace = true
|
|
tracing.workspace = true
|
|
uuid.workspace = true
|
|
|
|
[dev-dependencies]
|
|
maestro-tui.workspace = true
|
|
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util"] }
|