--- name: e2e-binary description: "Use when user-visible behavior of a CLI, eval, or RPC binary is added or changed: prove it end to end through the built binary with real files and sockets." --- # End to end through the binary One workflow, one test, the real executable. ## Shape - Spawn the built binary (`assert_cmd`); never call library fns from an e2e test. - Isolate: own temp dir per test, `XDG_*` pointed at it, every credential and selection env var removed, then set only what the scenario needs. - Real inputs: files on disk, a loopback socket, stdin bytes; providers scripted (`--mock` or a fixture server), never live. - Assert outcomes a user sees: exit status, stdout, stderr wording, files left behind, permissions. Not internals. - Name the test after the workflow: `eval_json_reports_cost`, `rpc_abort_ends_the_running_prompt`. - RPC: drive stdin line by line, read stdout until the expected `event`, then close stdin and assert clean exit. ## Rules - Every user-visible workflow has exactly one e2e owner; unit tests cover the branches. - No sleeps; wait on output with a deadline. - Secrets never appear in stdout, stderr, or files; assert their absence. - Keep e2e binaries in their own tier (`e2e_*`); they are slower and run per push. ## Sources - [assert_cmd](https://docs.rs/assert_cmd), [predicates](https://docs.rs/predicates) - [nextest filtersets](https://nexte.st/docs/filtersets/)