fix(ci): merge-train --fast mirrors test:unit subdir allowlist (#7688)

The fast bucket fed every changed tests/unit file to node:test; vitest-only
subdirs (autoCombo) always fail under that runner and redden the train. The
classifier now carries the same {api,auth,…} allowlist as package.json's
test:unit (guarded by a sync test) and stops excluding ui/*.test.ts, which
test:unit does run.
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-23 01:33:13 -03:00
committed by GitHub
parent 5fdbd7f326
commit 08129cfb0c
3 changed files with 31 additions and 1 deletions

View File

@@ -164,7 +164,10 @@ if [ "$FAST" = "1" ]; then
# node:test files changed by the boarded PRs (tests/unit/**/*.test.{ts,mjs};
# tests/unit/ui/*.test.tsx belongs to the vitest-ui runner, not node:test).
mapfile -t CHANGED < <(git -C "$WT" diff --name-only "origin/${BASE}" HEAD -- 'tests/unit' \
| grep -E '\.test\.(ts|mjs)$' | grep -v '^tests/unit/ui/' || true)
| grep -E '\.test\.(ts|mjs)$' || true)
# Subdirs test:unit actually runs (package.json allowlist) — anything else under
# tests/unit/<sub>/ belongs to another runner (e.g. autoCombo -> vitest).
UNIT_SUBDIRS=",api,auth,authz,build,cli,cli-helper,combo,compression,correctness,cors,db,db-adapters,docs,gamification,guardrails,lib,mcp,memory,runtime,security,services,settings,shared,ui,usage,"
MAIN=()
DASH=()
SERIAL=()
@@ -173,6 +176,13 @@ if [ "$FAST" = "1" ]; then
case "$f" in
tests/unit/dashboard/*) DASH+=("$f") ;;
tests/unit/serial/*) SERIAL+=("$f") ;;
*.test.mjs) MAIN+=("$f") ;; # tests/unit/**/*.test.mjs runs from any subdir
tests/unit/*/*)
sub="${f#tests/unit/}"; sub="${sub%%/*}"
case "$UNIT_SUBDIRS" in
*",${sub},"*) MAIN+=("$f") ;;
*) echo "[merge-train] (fast) skip ${f} — subdir '${sub}' not in test:unit (other runner)" ;;
esac ;;
*) MAIN+=("$f") ;;
esac
done