From 9a57af609222cb258fb3a6f8bf4ca4d138ecf503 Mon Sep 17 00:00:00 2001 From: "CJACK." Date: Sun, 22 Feb 2026 23:28:40 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=A2=9E=E5=8A=A0=20Node=20=E5=8D=95?= =?UTF-8?q?=E6=B5=8B=E5=A4=B1=E8=B4=A5=E6=91=98=E8=A6=81=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/scripts/run-unit-node.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/scripts/run-unit-node.sh b/tests/scripts/run-unit-node.sh index 515a961..69ddf4e 100755 --- a/tests/scripts/run-unit-node.sh +++ b/tests/scripts/run-unit-node.sh @@ -5,4 +5,18 @@ ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)" cd "$ROOT_DIR" ./tests/scripts/check-node-split-syntax.sh -node --test tests/node/stream-tool-sieve.test.js tests/node/chat-stream.test.js tests/node/js_compat_test.js "$@" + +# Keep Node's file-level test scheduling serial to avoid intermittent cross-file +# interference when multiple suites import mutable module singletons. +NODE_TEST_LOG="$(mktemp)" +cleanup() { + rm -f "$NODE_TEST_LOG" +} +trap cleanup EXIT + +if ! node --test --test-concurrency=1 tests/node/stream-tool-sieve.test.js tests/node/chat-stream.test.js tests/node/js_compat_test.js "$@" 2>&1 | tee "$NODE_TEST_LOG"; then + echo + echo "[run-unit-node] Node tests failed. 失败摘要如下:" + rg -n "^(not ok|# fail)|ERR_TEST_FAILURE" "$NODE_TEST_LOG" || true + exit 1 +fi