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
docs(vcr): improve VCR documentation with @VCRModel annotation, env var override
- Updated Basic Usage section to show declarative @VCRModel annotation approach
- Added VCR_MODE environment variable override documentation
- Fixed outdated references (VCRCassetteStore now implemented, not 'coming soon')
- Changed -Dvcr.mode system property reference to VCR_MODE env var
- Added IMPORTANT note about model initialization timing requirement
IMPORTANT: Models must be initialized at field declaration time, not in `@BeforeEach`. The VCR extension wraps `@VCRModel` fields before `@BeforeEach` methods run.
115
+
80
116
== VCR Modes
81
117
82
118
The VCR system supports six modes to control recording and playback behavior:
@@ -110,6 +146,24 @@ The VCR system supports six modes to control recording and playback behavior:
110
146
* **CI/CD**: Use `PLAYBACK` to ensure tests are deterministic
111
147
* **Initial setup**: Use `RECORD` to capture all cassettes
112
148
149
+
=== Environment Variable Override
150
+
151
+
Override the VCR mode at runtime using the `VCR_MODE` environment variable. This takes precedence over the annotation mode:
152
+
153
+
[source,bash]
154
+
----
155
+
# Force RECORD mode to capture new cassettes
156
+
VCR_MODE=RECORD OPENAI_API_KEY=your-key ./gradlew test
157
+
158
+
# Force PLAYBACK mode (no API key required)
159
+
VCR_MODE=PLAYBACK ./gradlew test
160
+
161
+
# Force OFF mode to bypass VCR
162
+
VCR_MODE=OFF OPENAI_API_KEY=your-key ./gradlew test
0 commit comments