Unverified Commit 7422109b authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

Run unit tests in a separate job (#55621)

This runs unit tests separate from the `test-dev` task to make it a bit more obvious these are running, and allow for an easy way to add any unit-test specific behavior in the future

[slack x-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1695150908857269)
parent bb13bb47
...@@ -160,6 +160,20 @@ jobs: ...@@ -160,6 +160,20 @@ jobs:
afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs --features tracing/release_max_level_info && git checkout . && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/integration/production/test/index.test.js test/e2e/streaming-ssr/index.test.ts afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs --features tracing/release_max_level_info && git checkout . && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/integration/production/test/index.test.js test/e2e/streaming-ssr/index.test.ts
secrets: inherit secrets: inherit
test-unit:
name: test unit
strategy:
fail-fast: false
matrix:
group: [1, 2, 3]
uses: ./.github/workflows/build_reusable.yml
with:
skipForDocsOnly: 'yes'
afterBuild: node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --type unit
secrets: inherit
test-dev: test-dev:
name: test dev name: test dev
needs: ['build-native', 'build-next'] needs: ['build-native', 'build-next']
...@@ -215,7 +229,7 @@ jobs: ...@@ -215,7 +229,7 @@ jobs:
secrets: inherit secrets: inherit
report-test-results: report-test-results:
needs: ['test-dev', 'test-prod', 'test-integration'] needs: ['test-unit', 'test-dev', 'test-prod', 'test-integration']
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
skipForDocsOnly: 'yes' skipForDocsOnly: 'yes'
...@@ -230,6 +244,7 @@ jobs: ...@@ -230,6 +244,7 @@ jobs:
'lint', 'lint',
'validate-docs-links', 'validate-docs-links',
'check-types-precompiled', 'check-types-precompiled',
'test-unit',
'test-dev', 'test-dev',
'test-prod', 'test-prod',
'test-integration', 'test-integration',
......
...@@ -45,7 +45,7 @@ const TIMINGS_API_HEADERS = { ...@@ -45,7 +45,7 @@ const TIMINGS_API_HEADERS = {
const testFilters = { const testFilters = {
development: new RegExp( development: new RegExp(
'^(test/(development|e2e|unit)|packages/.*/src/.*)/.*\\.test\\.(js|jsx|ts|tsx)$' '^(test/(development|e2e)|packages/.*/src/.*)/.*\\.test\\.(js|jsx|ts|tsx)$'
), ),
production: new RegExp( production: new RegExp(
'^(test/(production|e2e))/.*\\.test\\.(js|jsx|ts|tsx)$' '^(test/(production|e2e))/.*\\.test\\.(js|jsx|ts|tsx)$'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment