diff --git a/.github/workflows/test-unit-reusable.yml b/.github/workflows/test-unit-reusable.yml index 9505e24a9d5..7b2666edd16 100644 --- a/.github/workflows/test-unit-reusable.yml +++ b/.github/workflows/test-unit-reusable.yml @@ -73,7 +73,7 @@ jobs: # @n8n/vitest-config/node), peak forks ≈ 2 × 50% ≈ the core count, instead # of ~10 concurrent suites each spawning a core-sized pool and pegging CPU. - name: Test Unit (backend, except cli and nodes-base) - run: pnpm turbo test:unit --continue --concurrency=2 --filter='!./packages/frontend/**' --filter='!./packages/modules/**' --filter='!n8n' --filter='!n8n-nodes-base' --summarize + run: pnpm turbo test:unit --continue --concurrency=2 --filter='!./packages/frontend/**' --filter='!./packages/modules/*/frontend' --filter='!n8n' --filter='!n8n-nodes-base' --summarize - name: Test Unit (cli, scoped) if: ${{ !cancelled() }} @@ -133,7 +133,7 @@ jobs: # run serially to avoid cross-package interference. Unit jobs above # don't need this because they isolate per-process. - name: Test Integration (backend, except cli) - run: pnpm turbo test:integration --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/**' --filter='!n8n' --summarize + run: pnpm turbo test:integration --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/*/frontend' --filter='!n8n' --summarize - name: Test Integration (cli, scoped) if: ${{ !cancelled() }} diff --git a/package.json b/package.json index 8e5ef0e7ee9..a4750a6698d 100644 --- a/package.json +++ b/package.json @@ -71,12 +71,12 @@ "mutate:diff": "node scripts/mutation-health/mutate.mjs --diff", "test": "turbo run test", "test:ci": "turbo run test --continue --concurrency=1", - "test:ci:frontend": "turbo run test --continue --filter='./packages/frontend/**' --filter='./packages/modules/**'", - "test:ci:frontend:changed": "turbo run test:changed --continue --filter='./packages/frontend/**' --filter='./packages/modules/**'", - "test:ci:backend": "turbo run test --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/**'", - "test:ci:backend:unit": "turbo run test:unit --continue --filter='!./packages/frontend/**' --filter='!./packages/modules/**'", - "test:ci:backend:integration": "turbo run test:integration --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/**'", - "test:ci:backend:integration:changed": "turbo run test:integration:changed --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/**'", + "test:ci:frontend": "turbo run test --continue --filter='./packages/frontend/**' --filter='./packages/modules/*/frontend'", + "test:ci:frontend:changed": "turbo run test:changed --continue --filter='./packages/frontend/**' --filter='./packages/modules/*/frontend'", + "test:ci:backend": "turbo run test --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/*/frontend'", + "test:ci:backend:unit": "turbo run test:unit --continue --filter='!./packages/frontend/**' --filter='!./packages/modules/*/frontend'", + "test:ci:backend:integration": "turbo run test:integration --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/*/frontend'", + "test:ci:backend:integration:changed": "turbo run test:integration:changed --continue --concurrency=1 --filter='!./packages/frontend/**' --filter='!./packages/modules/*/frontend'", "test:affected": "turbo run test --affected --concurrency=1", "db:schema:docs": "turbo run build --filter=@n8n/db && pnpm --filter=@n8n/db schema:docs", "db:schema:check": "turbo run build --filter=@n8n/db && pnpm --filter=@n8n/db schema:check", diff --git a/packages/modules/README.md b/packages/modules/README.md index ef2d2bd7649..6501b71ebeb 100644 --- a/packages/modules/README.md +++ b/packages/modules/README.md @@ -8,6 +8,10 @@ through Vite aliases. modules under `packages/cli/src/modules/`. The extra nesting level is what lets both halves of a module sit together later. -The directory is empty until the first module lands, and tracked in the meantime because turbo -rejects a `--filter` whose directory does not exist. The root `test:ci:*` scripts and the two -backend jobs in `.github/workflows/test-unit-reusable.yml` all name `packages/modules/**`. +`packages/modules` itself stays tracked even when it holds nothing: turbo rejects a `--filter` +whose directory does not exist. + +CI splits the two halves by path. The frontend jobs select `packages/modules/*/frontend`. The backend +jobs exclude that same path instead of all of `packages/modules`, so a `/backend` package gets +backend CI on the day it appears. Both filters live in the root `test:ci:*` scripts and in the two +backend jobs in `.github/workflows/test-unit-reusable.yml`.