Unverified Commit 15fe5db1 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

test: update SA tree-shaking test (#70327)

parent 607e383d
...@@ -5,7 +5,9 @@ import { ...@@ -5,7 +5,9 @@ import {
} from '../_testing/utils' } from '../_testing/utils'
// TODO: revisit when we have a better side-effect free transform approach for server action // TODO: revisit when we have a better side-effect free transform approach for server action
describe.skip('actions-tree-shaking - basic', () => { ;(process.env.TURBOPACK ? describe : describe.skip)(
'actions-tree-shaking - basic',
() => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -31,4 +33,5 @@ describe.skip('actions-tree-shaking - basic', () => { ...@@ -31,4 +33,5 @@ describe.skip('actions-tree-shaking - basic', () => {
}, },
}) })
}) })
}) }
)
...@@ -5,7 +5,9 @@ import { ...@@ -5,7 +5,9 @@ import {
} from '../_testing/utils' } from '../_testing/utils'
// TODO: revisit when we have a better side-effect free transform approach for server action // TODO: revisit when we have a better side-effect free transform approach for server action
describe.skip('actions-tree-shaking - mixed-module-actions', () => { ;(process.env.TURBOPACK ? describe : describe.skip)(
'actions-tree-shaking - mixed-module-actions',
() => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -27,4 +29,5 @@ describe.skip('actions-tree-shaking - mixed-module-actions', () => { ...@@ -27,4 +29,5 @@ describe.skip('actions-tree-shaking - mixed-module-actions', () => {
}, },
}) })
}) })
}) }
)
...@@ -6,7 +6,9 @@ import { ...@@ -6,7 +6,9 @@ import {
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
// TODO: revisit when we have a better side-effect free transform approach for server action // TODO: revisit when we have a better side-effect free transform approach for server action
describe.skip('actions-tree-shaking - reexport', () => { ;(process.env.TURBOPACK ? describe : describe.skip)(
'actions-tree-shaking - reexport',
() => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true, skipDeployment: true,
...@@ -21,20 +23,21 @@ describe.skip('actions-tree-shaking - reexport', () => { ...@@ -21,20 +23,21 @@ describe.skip('actions-tree-shaking - reexport', () => {
expect(actionsRoutesState).toMatchObject({ expect(actionsRoutesState).toMatchObject({
'app/namespace-reexport/server/page': { 'app/namespace-reexport/server/page': {
rsc: 3, // Turbopack does not tree-shake server side chunks
rsc: process.env.TURBOPACK ? 3 : 1,
}, },
'app/namespace-reexport/client/page': { 'app/namespace-reexport/client/page': {
'action-browser': 3, // Turbopack does not support tree-shaking export * as we don't have global information
'action-browser': process.env.TURBOPACK ? 3 : 1,
}, },
// We're not able to tree-shake these re-exports here in webpack mode
'app/named-reexport/server/page': { 'app/named-reexport/server/page': {
rsc: 3, // Turbopack supports tree-shaking these re-exports
rsc: process.env.TURBOPACK ? 1 : 3,
}, },
'app/namespace-reexport-2/client/page': { 'app/named-reexport/client/page': {
'action-browser': 3, 'action-browser': 3,
}, },
'app/namespace-reexport-2/server/page': {
rsc: 3,
},
}) })
}) })
...@@ -65,4 +68,5 @@ describe.skip('actions-tree-shaking - reexport', () => { ...@@ -65,4 +68,5 @@ describe.skip('actions-tree-shaking - reexport', () => {
expect(output).toContain('action: test-2') expect(output).toContain('action: test-2')
}) })
}) })
}) }
)
...@@ -5,7 +5,9 @@ import { ...@@ -5,7 +5,9 @@ import {
} from '../_testing/utils' } from '../_testing/utils'
// TODO: revisit when we have a better side-effect free transform approach for server action // TODO: revisit when we have a better side-effect free transform approach for server action
describe.skip('actions-tree-shaking - shared-module-actions', () => { ;(process.env.TURBOPACK ? describe : describe.skip)(
'actions-tree-shaking - shared-module-actions',
() => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -32,4 +34,5 @@ describe.skip('actions-tree-shaking - shared-module-actions', () => { ...@@ -32,4 +34,5 @@ describe.skip('actions-tree-shaking - shared-module-actions', () => {
}, },
}) })
}) })
}) }
)
...@@ -4,8 +4,7 @@ import { ...@@ -4,8 +4,7 @@ import {
markLayoutAsEdge, markLayoutAsEdge,
} from '../_testing/utils' } from '../_testing/utils'
// TODO: revisit when we have a better side-effect free transform approach for server action describe('actions-tree-shaking - use-effect-actions', () => {
describe.skip('actions-tree-shaking - use-effect-actions', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
......
...@@ -15597,6 +15597,100 @@ ...@@ -15597,6 +15597,100 @@
"flakey": [], "flakey": [],
"runtimeError": false "runtimeError": false
}, },
"test/production/app-dir/actions-tree-shaking/basic/basic-edge.test.ts": {
"passed": [],
"failed": [
"actions-tree-shaking - basic should not have the unused action in the manifest"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/basic/basic.test.ts": {
"passed": [
"actions-tree-shaking - basic should not have the unused action in the manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/mixed-module-actions/mixed-module-actions-edge.test.ts": {
"passed": [
"actions-tree-shaking - mixed-module-actions should not do tree shake for cjs module when import server actions"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/mixed-module-actions/mixed-module-actions.test.ts": {
"passed": [
"actions-tree-shaking - mixed-module-actions should not do tree shake for cjs module when import server actions"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/reexport/reexport-edge.test.ts": {
"passed": [
"actions-tree-shaking - reexport should not have the unused action in the manifest"
],
"failed": [
"actions-tree-shaking - reexport should keep all the action exports for namespace export case on client layer"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/reexport/reexport.test.ts": {
"passed": [
"actions-tree-shaking - reexport should not have the unused action in the manifest"
],
"failed": [
"actions-tree-shaking - reexport should keep all the action exports for namespace export case on client layer"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions-edge.test.ts": {
"passed": [
"actions-tree-shaking - shared-module-actions should not have the unused action in the manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions.test.ts": {
"passed": [
"actions-tree-shaking - shared-module-actions should not have the unused action in the manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/use-effect-actions/use-effect-actions-edge.test.ts": {
"passed": [],
"failed": [
"actions-tree-shaking - use-effect-actions should not tree shake the used action under useEffect"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/use-effect-actions/use-effect-actions.test.ts": {
"passed": [],
"failed": [
"actions-tree-shaking - use-effect-actions should not tree shake the used action under useEffect"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts": { "test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts": {
"passed": [], "passed": [],
"failed": [ "failed": [
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