test: repair server parent lifecycle coverage and unblock cli suite #14

Merged
clawdie merged 7 commits from fix/test-server-parent-lifecycle into master 2026-09-19 16:54:42 +02:00
Owner

Repair of the fix/test-server-parent-lifecycle branch.

Changes

  1. Isolate parent lifecycle fixtures and assert process state (5d425184)

    • The tests inherited the ambient HERDR_SOCKET_PATH, so the spawned test server collided with a real running server ("herdr server is already running") and exited immediately; the assertions were then vacuous.
    • Now isolates HERDR_SOCKET_PATH, XDG dirs, HERDR_CONFIG_PATH and HERDR_CLIENT_SOCKET_PATH, waits for the API socket to accept connections before killing the supervisor, distinguishes exited/zombie processes from live ones, and registers the runtime dir with the shared cleanup watchdog (cleanup on success and failure).
  2. Accept freebsd plugin platform in manifests (7672ca8a)

    • RawPlatform rejected "freebsd" even though PluginPlatform::Freebsd exists. Pre-existing on master; the cli plugin tests declare freebsd, so install aborted early and one fake-server test deadlocked on accept().
  3. Format tests/support/mod.rs (557d915e)

    • rustfmt drift already present on master; required for cargo fmt --all -- --check.

Gates (fresh worktree at 557d915e)

  • cargo test --test server_parent_lifecycle -- --test-threads=1 -> 12 passed, 0 failed
  • cargo test --test detach_reattach -- --test-threads=1 -> 18 passed, 0 failed
  • cargo test --test cli -- --test-threads=1 -> 115 passed, 0 failed (75s)
  • cargo fmt --all -- --check -> clean
  • cargo check --locked -> ok
  • git diff --check -> clean

Known and out of scope

just check/just lint still fails on pre-existing clippy lints in untouched test files (clippy::needless_borrow in tests/cli/harness.rs, tests/server_headless.rs, tests/auto_detect.rs; clippy::items_after_test_module in tests/support/mod.rs), and bun is not installed for the docs/integration recipes. These predate the branch.

Review only; no merge requested.

Repair of the `fix/test-server-parent-lifecycle` branch. ## Changes 1. **Isolate parent lifecycle fixtures and assert process state** (`5d425184`) - The tests inherited the ambient `HERDR_SOCKET_PATH`, so the spawned test server collided with a real running server ("herdr server is already running") and exited immediately; the assertions were then vacuous. - Now isolates `HERDR_SOCKET_PATH`, XDG dirs, `HERDR_CONFIG_PATH` and `HERDR_CLIENT_SOCKET_PATH`, waits for the API socket to accept connections before killing the supervisor, distinguishes exited/zombie processes from live ones, and registers the runtime dir with the shared cleanup watchdog (cleanup on success and failure). 2. **Accept `freebsd` plugin platform in manifests** (`7672ca8a`) - `RawPlatform` rejected `"freebsd"` even though `PluginPlatform::Freebsd` exists. Pre-existing on `master`; the `cli` plugin tests declare `freebsd`, so install aborted early and one fake-server test deadlocked on `accept()`. 3. **Format `tests/support/mod.rs`** (`557d915e`) - rustfmt drift already present on `master`; required for `cargo fmt --all -- --check`. ## Gates (fresh worktree at `557d915e`) - `cargo test --test server_parent_lifecycle -- --test-threads=1` -> 12 passed, 0 failed - `cargo test --test detach_reattach -- --test-threads=1` -> 18 passed, 0 failed - `cargo test --test cli -- --test-threads=1` -> 115 passed, 0 failed (75s) - `cargo fmt --all -- --check` -> clean - `cargo check --locked` -> ok - `git diff --check` -> clean ## Known and out of scope `just check`/`just lint` still fails on pre-existing clippy lints in untouched test files (`clippy::needless_borrow` in `tests/cli/harness.rs`, `tests/server_headless.rs`, `tests/auto_detect.rs`; `clippy::items_after_test_module` in `tests/support/mod.rs`), and `bun` is not installed for the docs/integration recipes. These predate the branch. Review only; no merge requested.
The lifecycle tests inherited the ambient HERDR_SOCKET_PATH, so the test
server collided with a real running server with "herdr server is already
running" and exited immediately; both assertions then passed or failed
vacuously. Isolate HERDR_SOCKET_PATH, XDG dirs, HERDR_CONFIG_PATH and
HERDR_CLIENT_SOCKET_PATH, wait for the API socket to accept connections
before killing the supervisor, distinguish exited/zombie processes from
live ones, and register the runtime dir with the shared cleanup watchdog.
RawPlatform rejected "freebsd" even though PluginPlatform::Freebsd exists
and plugin_platform_name reports it. The cli plugin tests declare freebsd
in their manifests, so install aborted early; one fake-server test then
deadlocked on accept() waiting for a request that never came. Accept the
platform so the cli suite completes.
rustfmt drift already present on master; required for cargo fmt --all --
--check to pass.
clawdie merged commit ba4338db28 into master 2026-09-19 16:54:42 +02:00
clawdie deleted branch fix/test-server-parent-lifecycle 2026-09-19 16:54:42 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/herdr!14
No description provided.