Record model responses with --record-responses (for use in testing) (#11894)

This commit is contained in:
Jacob MacDonald
2025-10-28 12:13:45 -07:00
committed by GitHub
parent ab1f195508
commit 44bdd3ad11
19 changed files with 549 additions and 326 deletions

View File

@@ -56,6 +56,22 @@ To run a single test by its name, use the `--test-name-pattern` flag:
npm run test:e2e -- --test-name-pattern "reads a file"
```
### Regenerating model responses
Some integration tests use faked out model responses, which may need to be
regenerated from time to time as the implementations change.
To regenerate these golden files, set the REGENERATE_MODEL_GOLDENS environment
variable to "true" when running the tests, for example:
**WARNING**: If running locally you should review these updated responses for
any information about yourself or your system that gemini may have included in
these responses.
```bash
REGENERATE_MODEL_GOLDENS="true" npm run test:e2e
```
### Deflaking a test
Before adding a **new** integration test, you should test it at least 5 times