From ab0e5fecf20d5c82e32908b1a182b1462a6d0fe8 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 16 Aug 2026 19:09:58 +0800 Subject: [PATCH] =?UTF-8?q?chore(quality):=20=E5=9F=BA=E5=87=86=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E7=AC=AC=205=20=E7=BB=B4=E5=BA=A6=20=E2=80=94=20?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=20vitest=EF=BC=88=E5=85=A8=E7=BB=BF=E5=90=8E?= =?UTF-8?q?=E7=BA=B3=E5=85=A5=E9=98=B2=E5=9B=9E=E5=BD=92=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .auto/measure.sh | 11 ++++++++++- .auto/prompt.md | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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