anthonyoteri / anthonyoteri/cargo-rigtest
Failure capsule: single-archive repro artifact per failed test
- 主要语言
- Rust
- 星标
- 0
- 派生
- 0
- 平均合并
- 3 天 18 小时
- 30 天内合并 PR
- 8
描述
## Problem
When an acceptance test fails against a deployed system, the operator needs to reconstruct what happened: what HTTP requests were made, what responses came back, what SSH commands ran, which environment was targeted, what trace IDs to look up. Today this information is scattered across captured stdout/stderr (if reported at all), the operator's terminal scrollback, and the backend observability stack. Diagnosing a 2am page means stitching it together by hand.
## Proposed solution
On test failure, rigtest emits a single archive per failed test at `target/rigtest/failures/.capsule.tar.zst` containing the full evidence: HTTP request/response transcripts (headers + bodies, with credentials redacted), SSH command transcripts, the active profile snapshot, captured stdout/stderr, trace IDs, rigtest version, and the test source location. The on-call engineer downloads one artifact and has everything.
```text
target/rigtest/failures/homepage_returns_200.capsule.tar.zst
├── meta.json # test name, profile, attempt, rigtest version
├── http/ # one file per request/response pair
├── ssh/ # one file per command invocation
├── stdout.log
├── stderr.log
└── test-source.txt # file:line of the test function
```
## Alternatives considered
JUnit XML (already supported) is sufficient for CI dashboards but useless for forensic debugging. Telling users to enable structured logging in their tests pushes the problem onto them. Some test runners attach raw HAR files; the capsule is a richer, opinionated bundle.
## Additional context
This is the largest implementation surface of the candidate features — it requires intercepting at `ctx.client()` and `ctx.ssh()` to record transcripts in the child process, then shipping them back across the subprocess boundary on failure. Likely needs a new protocol channel (temp file handoff) since the existing stderr-framed protocol carries only small strings.
贡献指南
评估
这个 Issue 还没有评估数据。