Add keyless snapshot refresh mode
This commit is contained in:
@@ -7,10 +7,14 @@ import { defineConfig } from 'vitest/config'
|
||||
// normalized stdout transcript + re-persisted log against committed goldens.
|
||||
// `pnpm run test:snapshot:record` (DSH_SNAPSHOT=record + -u) re-records the
|
||||
// fixtures against the real API and refreshes the goldens.
|
||||
// `pnpm run test:snapshot:refresh` (DSH_SNAPSHOT=refresh) stays keyless: it
|
||||
// replays the committed model scripts and writes the current stdout/log goldens
|
||||
// without calling the live LLM.
|
||||
//
|
||||
// Replay loads no .env (it must never reach the network — a recorded fixture
|
||||
// drives the model). Record reads DEEPSEEK_API_KEY from the env or a gitignored
|
||||
// repo-root .env, so a contributor with a key only in .env can still record.
|
||||
// drives the model), and refresh uses that same keyless replay path. Record
|
||||
// reads DEEPSEEK_API_KEY from the env or a gitignored repo-root .env, so a
|
||||
// contributor with a key only in .env can still record.
|
||||
if (process.env.DSH_SNAPSHOT === 'record') {
|
||||
try {
|
||||
process.loadEnvFile(new URL('.env', import.meta.url).pathname)
|
||||
|
||||
Reference in New Issue
Block a user