fix(ci): resolve vitest entrypoint in gateway tests

The Linux CI run on 5cae559 still fails in openclaw-gateway-tests because
pnpm cannot resolve the vitest command in this Nix install layout.

Resolve vitest from node_modules directly and execute vitest.mjs with
node so the test derivation no longer depends on pnpm command dispatch or
a broken .bin shim.

Tests:
- sh -n nix/scripts/gateway-tests-check.sh
- verified remote failure in CI run 24212227890: ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "vitest" not found
This commit is contained in:
joshp123 2026-04-09 22:43:13 +02:00
parent 5cae559173
commit cfa94476f5

View File

@ -22,4 +22,16 @@ export VITEST_POOL="forks"
export VITEST_MIN_WORKERS="2"
export VITEST_MAX_WORKERS="2"
pnpm exec vitest run --config vitest.gateway.config.ts --testTimeout=20000
PATH="$PWD/node_modules/.bin:$PATH"
vitest_cli="$PWD/node_modules/vitest/vitest.mjs"
if [ ! -f "$vitest_cli" ]; then
vitest_cli="$(find "$PWD/node_modules" -path '*/vitest/vitest.mjs' -type f | head -n 1)"
fi
if [ -z "${vitest_cli:-}" ] || [ ! -f "$vitest_cli" ]; then
echo "vitest CLI not found under $PWD/node_modules" >&2
exit 1
fi
exec node "$vitest_cli" run --config vitest.gateway.config.ts --testTimeout=20000