diff --git a/.auto/measure.sh b/.auto/measure.sh index 46d15bd3..5ee85c8e 100755 --- a/.auto/measure.sh +++ b/.auto/measure.sh @@ -75,7 +75,16 @@ tsc_out=$(pnpm exec tsc --noEmit --jsx preserve 2>&1 || true) tsc_errors=$(grep -cE "error TS" <<< "$tsc_out" || true) echo "METRIC tsc_errors=$tsc_errors" +# ---------- Frontend: vitest (2026-08-16 起全绿,纳入基准防回归) ---------- +vitest_out=$(pnpm exec vitest run --reporter=dot 2>&1 || true) +vitest_failed=0; vitest_total=0 +if [[ "$vitest_out" =~ ([0-9]+)\ failed ]]; then vitest_failed="${BASH_REMATCH[1]}"; fi +if [[ "$vitest_out" =~ Tests[[:space:]]+([0-9]+)\ passed ]]; then vitest_total="${BASH_REMATCH[1]}"; fi +if [[ "$vitest_out" =~ Tests[[:space:]]+([0-9]+) ]]; then vitest_total="${BASH_REMATCH[1]}"; fi +echo "METRIC vitest_failed=$vitest_failed" +echo "METRIC vitest_total=$vitest_total" + end=$(date +%s) -total=$((golang_total + golang_test_total + golang_vetx_total + eslint_problems + tsc_errors)) +total=$((golang_total + golang_test_total + golang_vetx_total + eslint_problems + tsc_errors + vitest_failed)) echo "METRIC total_issues=$total" echo "METRIC measure_s=$((end - start))" \ No newline at end of file diff --git a/.auto/prompt.md b/.auto/prompt.md index 9850f15b..86fe7320 100644 --- a/.auto/prompt.md +++ b/.auto/prompt.md @@ -54,6 +54,10 @@ counts test-file quality. DELIBERATELY excludes paralleltest/tparallel (t.Parallel advice is unsafe here: many suites share DB/redis state and tests cannot be run in this env) and gocritic extras (noise). Fix test issues only when compile-safe (go vet compiles tests) and semantically neutral. + +Frontend vitest dimension (added run #19, after suite went green in run #18): +`pnpm exec vitest run --reporter=dot` — `vitest_failed` counts into total. +The suite is fully runnable locally (jsdom + mocks; no external services). Do not add/remove linters or change settings to make the number go down. ## Files in Scope