Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add react@experimental testing #23359

Merged
merged 11 commits into from
Apr 13, 2021
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