Run live evals (worker)
What this runs
- •
apps/worker/test/parse.evals.test.ts(the eval manifest / fixtures) - •
apps/worker/test/parse.gemini.test.ts(text + URL + image live parsing)
These are “live” because they call the real Gemini API using GOOGLE_GENERATIVE_AI_API_KEY.
Prereqs
- •Ensure
apps/worker/.dev.varsexists and containsGOOGLE_GENERATIVE_AI_API_KEY=... - •Do not commit
.dev.vars(it contains secrets)
Run
From repo root:
bash
pnpm test:live-evals
Equivalent manual command:
bash
set -a && . "apps/worker/.dev.vars" && set +a && RUN_LIVE_AI_TESTS=1 \ pnpm --filter worker test -- test/parse.evals.test.ts test/parse.gemini.test.ts
Common gotchas
- •Tests “skipped”: live suites are gated on
RUN_LIVE_AI_TESTS=1and a present API key. - •Workers runtime env: in
@cloudflare/vitest-pool-workerstests, prefercloudflare:testenvbindings for gates instead of relying onprocess.env.