ProcessHarness: builder, lifecycle, stdout/stderr capture #2
Labels
No labels
area:assertions
area:cli
area:client
area:harness
area:meta
area:reporting
area:runner
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/ws-rpc-test#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a test author, I want to declaratively configure and start an application binary with one builder call, so that I can run end-to-end tests against it without writing process-management plumbing.
Acceptance criteria
Builder
HarnessBuilderexposes:command(impl Into<String>),arg,args,env(K, V),working_dir,health_url,ws_url,startup_timeout(default 15 s),shutdown_timeout(default 10 s),health_poll_interval(default 100 ms),build().ProcessHarness::builder()returns a freshHarnessBuilder.Start
start()spawns the configured child process.DISPLAYandXDG_RUNTIME_DIRare forwarded automatically from the parent env if set (for GUI apps).working_diris set on the child if provided.Stop
stop()sendsSIGTERM, waits up toshutdown_timeoutfor graceful exit, then escalates toSIGKILL.Droptriggers a synchronous best-effortSIGTERM+SIGKILLso a panicking test never leaks the child.Restart
restart()callsstop()thenstart()and only returnsOkonce the health check passes again (delegated to the health-polling story).Stdout/stderr capture
stdout() -> &strandstderr() -> &straccessors return current content.Platform
#[cfg(unix)]and anunimplemented!on Windows (clearly documented).Out of scope
References