Eval Fixtures from Traces
In this article
- Pick the spans of a failed trace that a test case needs, and say why the rest can go.
- Replace personal data and drop secrets so no production value reaches the test set.
- Decide what a flaky tool call becomes in the case.
- Label the case with its source trace id, owner, cause, expected end state and what must not happen.
- Terms defined here: trace-to-eval.
Overview
You found the bug. A customer asked for a $25.00 refund, the assistant tried to refund $2,500.00, code stopped it, and a person had to step in. The tools team ships a fix. How do you make sure nobody brings the same bug back in three months?
You save the failure as a test. The trace, the recorded steps of that run, already holds everything the test needs, and a lot it must not keep: other calls, a customer's name and email, the access token one service sent to another. You will cut one failed run down to the few steps that still reproduce it, clean out every production value, and label it so anyone who sees it fail later knows where it came from and who fixes it.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- What a fixture holds
- Which spans the failure needs
- Clean before you save
- Label the case
- The fixture
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions