Skip to content

Commit

Permalink
Add react@experimental testing (vercel#23359)
Browse files Browse the repository at this point in the history
  • Loading branch information
devknoll authored and SokratisVidros committed Apr 20, 2021
1 parent ddb1e92 commit 91c29e8
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/test_react_experimental.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0,12 * * *'

name: Test react@experimental

jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2

# - run: yarn install --frozen-lockfile --check-files
# env:
# NEXT_TELEMETRY_DISABLED: 1

# - run: yarn upgrade react@next react-dom@next -W --dev

# - uses: actions/cache@v2
# id: cache-build
# with:
# path: ./*
# key: ${{ github.sha }}

testAll:
name: Test All
runs-on: ubuntu-latest
# needs: build
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_PRIVATE_REACT_MODE: concurrent
HEADLESS: true
NEXT_PRIVATE_SKIP_SIZE_TESTS: true
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
steps:
# - uses: actions/cache@v2
# id: restore-build
# with:
# path: ./*
# key: ${{ github.sha }}

- uses: actions/checkout@v2

- run: yarn install --frozen-lockfile --check-files

- run: yarn upgrade react@experimental react-dom@experimental -W --dev

# TODO: remove after we fix watchpack watching too much
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
1 change: 1 addition & 0 deletions .github/workflows/test_react_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
NEXT_PRIVATE_SKIP_SIZE_TESTS: true
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion packages/next/next-server/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const defaultConfig: NextConfig = {
plugins: false,
profiling: false,
sprFlushToDisk: true,
reactMode: 'legacy',
reactMode: (process.env.NEXT_PRIVATE_REACT_MODE as any) || 'legacy',
workerThreads: false,
pageEnv: false,
optimizeImages: false,
Expand Down
4 changes: 4 additions & 0 deletions test/integration/build-output/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ describe('Build Output', () => {
it('should not deviate from snapshot', async () => {
console.log(stdout)

if (process.env.NEXT_PRIVATE_SKIP_SIZE_TESTS) {
return
}

const parsePageSize = (page) =>
stdout.match(
new RegExp(` ${page} .*?((?:\\d|\\.){1,} (?:\\w{1,})) `)
Expand Down
4 changes: 4 additions & 0 deletions test/integration/fallback-modules/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ describe('Build Output', () => {
})

it('should not include crypto', async () => {
if (process.env.NEXT_PRIVATE_SKIP_SIZE_TESTS) {
return
}

;({ stdout } = await nextBuild(appDir, [], {
stdout: true,
}))
Expand Down
4 changes: 4 additions & 0 deletions test/integration/size-limit/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ describe('Production response size', () => {
})

it('should not increase the overall response size of default build', async () => {
if (process.env.NEXT_PRIVATE_SKIP_SIZE_TESTS) {
return
}

const responseSizes = [
baseResponseSize,
...(await getResponseSizes(scriptsUrls)),
Expand Down

0 comments on commit 91c29e8

Please sign in to comment.