diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 376a9abff24..fc31e6c08ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -545,7 +545,6 @@ jobs: echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV" if [ "$TASK" = "channels" ]; then echo "OPENCLAW_VITEST_MAX_WORKERS=1" >> "$GITHUB_ENV" - echo "OPENCLAW_TEST_ISOLATE=1" >> "$GITHUB_ENV" fi - name: Download dist artifact diff --git a/package.json b/package.json index d93011b8960..9a199baa30d 100644 --- a/package.json +++ b/package.json @@ -1091,13 +1091,13 @@ "runtime-sidecars:gen": "node --import tsx scripts/generate-runtime-sidecar-paths-baseline.ts --write", "stage:bundled-plugin-runtime-deps": "node scripts/stage-bundled-plugin-runtime-deps.mjs", "start": "node scripts/run-node.mjs", - "test": "node scripts/test-projects.mjs", + "test": "vitest run --config vitest.config.ts", "test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all", "test:auth:compat": "node scripts/run-vitest.mjs run --config vitest.gateway.config.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/client.test.ts src/gateway/reconnect-gating.test.ts src/gateway/protocol/connect-error-details.test.ts", "test:build:singleton": "node scripts/test-built-plugin-singleton.mjs", "test:bundled": "node scripts/run-vitest.mjs run --config vitest.bundled.config.ts", - "test:changed": "node scripts/run-vitest.mjs run --config vitest.config.ts --changed origin/main", - "test:changed:max": "OPENCLAW_VITEST_MAX_WORKERS=8 node scripts/run-vitest.mjs run --config vitest.config.ts --changed origin/main", + "test:changed": "vitest run --config vitest.config.ts --changed origin/main", + "test:changed:max": "OPENCLAW_VITEST_MAX_WORKERS=8 vitest run --config vitest.config.ts --changed origin/main", "test:channels": "node scripts/run-vitest.mjs run --config vitest.channels.config.ts", "test:contracts": "pnpm test:contracts:channels && pnpm test:contracts:plugins", "test:contracts:channels": "node scripts/run-vitest.mjs run --config vitest.contracts.config.ts --maxWorkers=1 src/channels/plugins/contracts", @@ -1126,7 +1126,7 @@ "test:extensions:memory": "node scripts/profile-extension-memory.mjs", "test:fast": "node scripts/run-vitest.mjs run --config vitest.unit.config.ts", "test:force": "node --import tsx scripts/test-force.ts", - "test:gateway": "node scripts/run-vitest.mjs run --config vitest.gateway.config.ts --pool=forks", + "test:gateway": "vitest run --config vitest.gateway.config.ts", "test:gateway:watch-regression": "node scripts/check-gateway-watch-regression.mjs", "test:install:e2e": "bash scripts/test-install-sh-e2e-docker.sh", "test:install:e2e:anthropic": "OPENCLAW_E2E_MODELS=anthropic bash scripts/test-install-sh-e2e-docker.sh", @@ -1135,7 +1135,7 @@ "test:live": "node scripts/test-live.mjs", "test:live:gateway-profiles": "node scripts/test-live.mjs -- src/gateway/gateway-models.profiles.live.test.ts", "test:live:models-profiles": "node scripts/test-live.mjs -- src/agents/models.profiles.live.test.ts", - "test:max": "OPENCLAW_VITEST_MAX_WORKERS=8 node scripts/test-projects.mjs", + "test:max": "OPENCLAW_VITEST_MAX_WORKERS=8 vitest run --config vitest.config.ts", "test:parallels:linux": "bash scripts/e2e/parallels-linux-smoke.sh", "test:parallels:macos": "bash scripts/e2e/parallels-macos-smoke.sh", "test:parallels:npm-update": "bash scripts/e2e/parallels-npm-update-smoke.sh", @@ -1147,7 +1147,7 @@ "test:perf:profile:main": "node scripts/run-vitest-profile.mjs main", "test:perf:profile:runner": "node scripts/run-vitest-profile.mjs runner", "test:sectriage": "node scripts/run-vitest.mjs run --config vitest.gateway.config.ts && node scripts/run-vitest.mjs run --config vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", - "test:serial": "OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/test-projects.mjs", + "test:serial": "OPENCLAW_VITEST_MAX_WORKERS=1 vitest run --config vitest.config.ts", "test:startup:bench": "node --import tsx scripts/bench-cli-startup.ts", "test:startup:bench:check": "node scripts/test-cli-startup-bench-budget.mjs", "test:startup:bench:save": "node --import tsx scripts/bench-cli-startup.ts --preset all --runs 5 --warmup 1 --output .artifacts/cli-startup-bench-all.json", @@ -1156,7 +1156,7 @@ "test:startup:memory": "node scripts/check-cli-startup-memory.mjs", "test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test", "test:voicecall:closedloop": "node scripts/test-voicecall-closedloop.mjs", - "test:watch": "node scripts/test-projects.mjs --watch", + "test:watch": "vitest --config vitest.config.ts", "ts-topology": "node --import tsx scripts/ts-topology.ts", "tsgo": "node scripts/run-tsgo.mjs", "tui": "node scripts/run-node.mjs tui", diff --git a/scripts/test-force.ts b/scripts/test-force.ts index 0c553423138..fe491e06783 100755 --- a/scripts/test-force.ts +++ b/scripts/test-force.ts @@ -28,7 +28,7 @@ function runTests() { const isolatedLock = process.env.OPENCLAW_GATEWAY_LOCK ?? path.join(os.tmpdir(), `openclaw-gateway.lock.test.${Date.now()}`); - const result = spawnSync("pnpm", ["exec", "vitest", "run"], { + const result = spawnSync("pnpm", ["exec", "vitest", "run", "--config", "vitest.config.ts"], { stdio: "inherit", env: { ...process.env, diff --git a/scripts/test-voicecall-closedloop.mjs b/scripts/test-voicecall-closedloop.mjs index b054ed059aa..bc918cb2f82 100644 --- a/scripts/test-voicecall-closedloop.mjs +++ b/scripts/test-voicecall-closedloop.mjs @@ -5,6 +5,8 @@ import { bundledPluginFile } from "./lib/bundled-plugin-paths.mjs"; const args = [ "run", + "--config", + "vitest.config.ts", bundledPluginFile("voice-call", "src/manager.test.ts"), bundledPluginFile("voice-call", "src/media-stream.test.ts"), "src/plugins/voice-call.plugin.test.ts",