From 1eb218f76ade2e32848d4fe586429c6b77c7c738 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Fri, 10 Jul 2026 07:23:17 -0300 Subject: [PATCH] ci(quality): TIA impacted-run splits dashboard tests onto the tsx loader (closes #6787) (#6788) The impacted branch ran every selected file under --import tsx/esm; the canonical test:unit:ci:shard runs tests/unit/dashboard/** under --import tsx (CJS transform, required for @lobehub/icons/es/* deep imports). Any PR whose impact map reached a dashboard component false-redded with 'Unexpected token export' (reproduced on unrelated PRs #6317 and #6335 the same evening). The selection is now split by segment with loader parity. --- .github/workflows/quality.yml | 21 ++++++++++++++++++- .../fixes/6788-tia-dashboard-loader.md | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fixes/6788-tia-dashboard-loader.md diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 7b10170301..04d69911ec 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -108,7 +108,26 @@ jobs: fi echo "Running impacted tests:"; echo "$SEL" mapfile -t FILES <<< "$SEL" - node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit --test-concurrency=4 "${FILES[@]}" + # Loader parity with test:unit:ci:shard (#6787): tests/unit/dashboard/** runs + # under `--import tsx` (CJS transform — required for ESM-only deep imports like + # @lobehub/icons/es/* reached via lobeProviderIcons.ts); everything else under + # `--import tsx/esm`. A single tsx/esm invocation false-reds every dashboard + # module-shape test the impact map selects ("Unexpected token 'export'"). + DASH=(); REST=() + for f in "${FILES[@]}"; do + case "$f" in + tests/unit/dashboard/*) DASH+=("$f") ;; + *) REST+=("$f") ;; + esac + done + RC=0 + if [ ${#REST[@]} -gt 0 ]; then + node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit --test-concurrency=4 "${REST[@]}" || RC=$? + fi + if [ ${#DASH[@]} -gt 0 ]; then + node --import tsx --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit --test-concurrency=4 "${DASH[@]}" || RC=$? + fi + exit $RC fast-vitest: name: Vitest (fast-path) diff --git a/changelog.d/fixes/6788-tia-dashboard-loader.md b/changelog.d/fixes/6788-tia-dashboard-loader.md new file mode 100644 index 0000000000..50e6f4f06b --- /dev/null +++ b/changelog.d/fixes/6788-tia-dashboard-loader.md @@ -0,0 +1 @@ +- **fix(ci):** the blocking "Impacted unit tests (TIA)" step false-redded any PR whose impact graph reached a dashboard component — it ran every selected test under `--import tsx/esm`, but `tests/unit/dashboard/**` requires the `--import tsx` CJS transform (ESM-only deep imports like `@lobehub/icons/es/*`), exactly as the canonical `test:unit:ci:shard` already does per segment. The impacted selection is now split by segment with matching loaders (closes #6787).