Commit 5d08e94
committed
feat(vcr): add experimental VCR test system for LLM/embedding recording
Implements a VCR (Video Cassette Recorder) test system that enables recording
and replaying LLM and embedding API calls for deterministic, fast, and
cost-effective testing.
Core components:
- VCRMode: 6 modes (PLAYBACK, RECORD, RECORD_NEW, RECORD_FAILED,
PLAYBACK_OR_RECORD, OFF) with smart mode selection
- VCRExtension: JUnit 5 extension with full lifecycle callbacks
- VCRContext: Redis container management with AOF/RDB persistence
- VCRRegistry: Test recording status tracking with smart mode logic
- @VCRTest, @VCRRecord, @VCRDisabled: Annotations for test configuration
Key features:
- Redis-based cassette storage with persistence to src/test/resources/vcr-data
- Testcontainers integration for isolated Redis instances
- Call counter management for deterministic key generation
- Statistics tracking (cache hits, misses, API calls)
- Configurable data directory and Redis image
Also includes:
- Comprehensive documentation in docs/experimental section
- README section with quick start example
- Design documents for VCR system and EmbeddingsCache enhancement
All 39 VCR tests passing. LLM/embedding interceptor implementation pending.1 parent de520da commit 5d08e94
File tree
16 files changed
+2843
-0
lines changed- core
- src
- main/java/com/redis/vl/test/vcr
- test/java/com/redis/vl/test/vcr
- docs
- content/modules/ROOT
- pages
- design
16 files changed
+2843
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
379 | 407 | | |
380 | 408 | | |
381 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
| |||
0 commit comments