mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-08 13:00:52 +00:00
feat(tests): implement test isolation for inference recordings (#3681)
Uses test_id in request hashes and test-scoped subdirectories to prevent cross-test contamination. Model list endpoints exclude test_id to enable merging recordings from different servers. Additionally, this PR adds a `record-if-missing` mode (which we will use instead of `record` which records everything) which is very useful. 🤖 Co-authored with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f176196fba
commit
045a0c1d57
428 changed files with 85345 additions and 104330 deletions
|
@ -125,21 +125,28 @@ pytest -s -v tests/integration/vector_io/ \
|
|||
|
||||
## Recording Modes
|
||||
|
||||
The testing system supports three modes controlled by environment variables:
|
||||
The testing system supports four modes controlled by environment variables:
|
||||
|
||||
### REPLAY Mode (Default)
|
||||
Uses cached responses instead of making API calls:
|
||||
```bash
|
||||
pytest tests/integration/
|
||||
```
|
||||
|
||||
### RECORD-IF-MISSING Mode (Recommended for adding new tests)
|
||||
Records only when no recording exists, otherwise replays. This is the preferred mode for iterative development:
|
||||
```bash
|
||||
pytest tests/integration/inference/test_new_feature.py --inference-mode=record-if-missing
|
||||
```
|
||||
|
||||
### RECORD Mode
|
||||
Captures API interactions for later replay:
|
||||
**Force-records all API interactions**, overwriting existing recordings. Use with caution as this will re-record everything:
|
||||
```bash
|
||||
pytest tests/integration/inference/test_new_feature.py --inference-mode=record
|
||||
```
|
||||
|
||||
### LIVE Mode
|
||||
Tests make real API calls (but not recorded):
|
||||
Tests make real API calls (not recorded):
|
||||
```bash
|
||||
pytest tests/integration/ --inference-mode=live
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue