chore(llms): gate live model tests behind test:live (#610)

* chore(llms): gate live model tests behind test:live

Keep *.live.test.ts out of npm test so local CI stays fast; run them
explicitly via npm run test:live when checking provider compatibility.

* chore: skill gh permission
This commit is contained in:
Simon
2026-07-10 00:48:52 -07:00
committed by GitHub
parent 4c76a5f1d2
commit d5c994708c
6 changed files with 35 additions and 9 deletions
+2 -1
View File
@@ -43,7 +43,8 @@
"homepage": "https://alibaba.github.io/page-agent/",
"scripts": {
"build": "vite build",
"test": "vitest run",
"test": "vitest run --project llms",
"test:live": "vitest run --project llms:live",
"prepublishOnly": "node ../../scripts/pre-publish.js",
"postpublish": "node ../../scripts/post-publish.js"
},
@@ -10,9 +10,10 @@
* Tests `OpenAIClient` directly (not the `LLM` retry wrapper), so a failure
* always reflects the very first request/response no retry can mask it.
*
* Each provider's tests skip (not fail) when its `TESTING_*_KEY` env var is
* absent, so this stays CI-safe. To actually run these, put keys in the
* repo-root `.env`:
* Per the `*.live.test.ts` convention this suite is excluded from `npm test`
* (slow, costs tokens) run it manually with `npm run test:live`. Each
* provider's tests skip (not fail) when its `TESTING_*_KEY` env var is
* absent. Keys live in the repo-root `.env`:
*
* TESTING_OPENROUTER_KEY=...
* TESTING_DEEPSEEK_KEY=...
+20 -5
View File
@@ -1,12 +1,27 @@
import { defineConfig } from 'vitest/config'
import { configDefaults, defineConfig } from 'vitest/config'
// Convention: `*.live.test.ts` hits real provider APIs (slow, costs tokens)
// and only runs via `npm run test:live`. Everything else runs on `npm test`.
export default defineConfig({
test: {
name: 'llms',
include: ['src/**/*.test.ts'],
// Keep live provider suites under OpenRouter's ~20 req/min free-route cap.
maxConcurrency: 2,
// Suppress console output from passing tests; failed tests still get their logs.
silent: 'passed-only',
projects: [
{
test: {
name: 'llms',
include: ['src/**/*.test.ts'],
exclude: [...configDefaults.exclude, 'src/**/*.live.test.ts'],
},
},
{
test: {
name: 'llms:live',
include: ['src/**/*.live.test.ts'],
// Keep live provider suites under OpenRouter's ~20 req/min free-route cap.
maxConcurrency: 2,
},
},
],
},
})