Add react@experimental testing (#23359)

This commit is contained in:
Gerald Monaco 2021-04-13 10:16:45 -07:00 committed by GitHub
parent c3390b8cca
commit cb7ef3feb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 1 deletions

View file

@ -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

View file

@ -30,6 +30,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
NEXT_PRIVATE_SKIP_SIZE_TESTS: true
strategy:
fail-fast: false
matrix:

View file

@ -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,

View file

@ -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,})) `)

View file

@ -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,
}))

View file

@ -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)),