From b0864a59d787388df1bdab5d533420316d3219e3 Mon Sep 17 00:00:00 2001 From: thanhnv Date: Wed, 1 Jul 2026 17:24:57 +0900 Subject: [PATCH] fix(ci): security-gate skips frontend tests when vitest not installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit security-gate.sh checked only `command -v node` before running `npm test -w frontend`. In the CI security-gate job, node is in PATH (from actions/setup-node) but root node_modules are NOT installed (npm ci was removed to prevent OOM). This caused the frontend test to fail with "Cannot find module vitest". Fix: also require node_modules/.bin/vitest to exist. Without it the step SKIPs gracefully — frontend tests are already covered by the dedicated frontend-tests CI job which runs first. Co-Authored-By: Claude Sonnet 4.6 --- AINative_OKR_CASAN5/.specify/scripts/bash/security-gate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AINative_OKR_CASAN5/.specify/scripts/bash/security-gate.sh b/AINative_OKR_CASAN5/.specify/scripts/bash/security-gate.sh index 7b386b4..016ecdc 100755 --- a/AINative_OKR_CASAN5/.specify/scripts/bash/security-gate.sh +++ b/AINative_OKR_CASAN5/.specify/scripts/bash/security-gate.sh @@ -41,10 +41,10 @@ if [[ -d "$FNM_NODE_DIR" ]]; then NODE_BIN=$(find "$FNM_NODE_DIR" -name "node.exe" -maxdepth 4 2>/dev/null | sort -V | tail -1) [[ -n "$NODE_BIN" ]] && export PATH="$(dirname "$NODE_BIN"):$PATH" fi -if command -v node >/dev/null 2>&1; then +if command -v node >/dev/null 2>&1 && [[ -f "$ROOT/node_modules/.bin/vitest" ]]; then run "frontend runtime tests (WV4-A)" bash -c "cd '$ROOT' && npm test -w frontend" else - echo " GATE SKIP frontend runtime tests (node not in PATH)"; SKIP=$((SKIP+1)) + echo " GATE SKIP frontend runtime tests (vitest not installed — covered by frontend-tests CI job)"; SKIP=$((SKIP+1)) fi echo "== verdict: PASS=$PASS FAIL=$FAIL SKIP=$SKIP =="