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).