You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,27 @@ Run type checking across the workspace:
66
66
uv run tox -e typecheck
67
67
```
68
68
69
+
#### Managing cassettes (test recordings)
70
+
71
+
GenAI tests replay recorded HTTP interactions (cassettes) stored under each
72
+
package's `tests/cassettes/`.
73
+
74
+
-**Run**: nothing extra — cassettes replay automatically when present. Tests
75
+
that need a cassette skip if it is missing and no real API key is set.
76
+
-**Record**: delete the target `tests/cassettes/<test_name>.yaml`, export a
77
+
real provider API key (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`), and
78
+
rerun the test. `pytest-vcr` writes the cassette on the live call.
79
+
-**Sanitize**: every package's `vcr_config()` in `tests/conftest.py` must
80
+
scrub auth via `filter_headers` and strip identifying response headers via
81
+
`scrub_response_headers(...)` from `opentelemetry.test_util_genai.vcr`.
82
+
Diff each new cassette before committing — leaked API keys, org ids, or
83
+
`Set-Cookie` values block the PR.
84
+
-**AI-generated cassettes**: if you lack provider access, you may
85
+
synthesize a cassette from the provider's API reference via AI. Make sure
86
+
to mention it in the PR and open a follow-up issue to re-record it in CI
87
+
against the real provider.
88
+
-**CI**: replay-only; recording in CI is a future improvement.
89
+
69
90
### 4. Update the changelog
70
91
71
92
This repo uses [towncrier](https://towncrier.readthedocs.io/) to manage
@@ -136,3 +157,4 @@ For more information about the maintainer role, see the [community repository](h
136
157
-[Leighton Chen](https://github.com/lzchen), Microsoft
137
158
138
159
For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
0 commit comments