chore(quality): 基准扩展第 5 维度 — 前端 vitest(全绿后纳入防回归)

This commit is contained in:
ryan
2026-08-16 19:09:58 +08:00
parent f5c9da03f4
commit ab0e5fecf2
2 changed files with 14 additions and 1 deletions
+10 -1
View File
@@ -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))"
+4
View File
@@ -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