test: split live tests into separate config

This commit is contained in:
Peter Steinberger
2026-01-08 02:00:11 +01:00
parent 28e725215d
commit 5e01e64cf3
4 changed files with 18 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ read_when:
- `pnpm test:force`: Kills any lingering gateway process holding the default control port, then runs the full Vitest suite with an isolated gateway port so server tests dont collide with a running instance. Use this when a prior gateway run left port 18789 occupied.
- `pnpm test:coverage`: Runs Vitest with V8 coverage. Global thresholds are 70% lines/branches/functions/statements. Coverage excludes integration-heavy entrypoints (CLI wiring, gateway/telegram bridges, webchat static server) to keep the target focused on unit-testable logic.
- `pnpm test:e2e`: Runs gateway end-to-end smoke tests (multi-instance WS/HTTP/node pairing).
- `pnpm test:live`: Runs provider live tests (minimax/zai). Requires API keys and `LIVE=1` (or provider-specific `*_LIVE_TEST=1`) to unskip.
## Model latency bench (local keys)

View File

@@ -69,6 +69,7 @@
"test:force": "tsx scripts/test-force.ts",
"test:coverage": "vitest run --coverage",
"test:e2e": "vitest run --config vitest.e2e.config.ts",
"test:live": "vitest run --config vitest.live.config.ts",
"test:docker:qr": "bash scripts/e2e/qr-import-docker.sh",
"protocol:gen": "tsx scripts/protocol-gen.ts",
"protocol:gen:swift": "tsx scripts/protocol-gen-swift.ts",

View File

@@ -10,6 +10,7 @@ export default defineConfig({
"apps/macos/.build/**",
"**/vendor/**",
"dist/Clawdbot.app/**",
"**/*.live.test.ts",
],
coverage: {
provider: "v8",

15
vitest.live.config.ts Normal file
View File

@@ -0,0 +1,15 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
include: ["src/**/*.live.test.ts"],
setupFiles: ["test/setup.ts"],
exclude: [
"dist/**",
"apps/macos/**",
"apps/macos/.build/**",
"**/vendor/**",
"dist/Clawdbot.app/**",
],
},
});