From 5b3713d3562b413630c699b727c6ba345c2e7ac1 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 15:54:56 -0400 Subject: [PATCH 01/26] add more Windows CI tests --- .github/workflows/main.yml | 62 ++++++++++++++------------------------ 1 file changed, 23 insertions(+), 39 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26cd33cd53..684cc42689 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,10 @@ jobs: build: name: Build - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} env: NEXT_TELEMETRY_DISABLED: 1 outputs: @@ -93,7 +96,7 @@ jobs: id: cache-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} testBlitzPackages: name: Blitz - Test Packages @@ -107,7 +110,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} - name: Setup kernel to increase watchers if: matrix.os == 'ubuntu-latest' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p @@ -119,6 +122,7 @@ jobs: testBlitzExamples: timeout-minutes: 30 name: Blitz - Test Example Apps + needs: build strategy: matrix: os: [ubuntu-latest, windows-latest] @@ -126,32 +130,12 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 25 - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: "14" - - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Cache node_modules - id: yarn-cache - uses: actions/cache@v2 + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - **/node_modules - key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- - - run: yarn install --frozen-lockfile --check-files - # - run: yarn cpy node_modules/.blitz packages/core/node_modules/.blitz - # if: matrix.os == 'windows-latest' - - name: Build Packages - run: yarn build + path: ./* + key: $${{ runner.os }}-{{ github.sha }} # Needed to get cypress binary - run: yarn cypress install - name: Install sass @@ -179,7 +163,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} - run: ./check-pre-compiled.sh if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -200,21 +184,21 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} - run: node run-tests.js --timings --type unit -g 1/1 if: ${{needs.build.outputs.docsChange != 'docs only change'}} testIntegrationBlitz: name: Blitz - Test Integration - runs-on: ubuntu-latest needs: build + strategy: + matrix: + os: [ubuntu-latest, windows-latest] env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 HEADLESS: true - strategy: - fail-fast: false steps: - run: echo ${{needs.build.outputs.docsChange}} - uses: actions/cache@v2 @@ -222,7 +206,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} # 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 @@ -254,7 +238,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} # 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 @@ -281,7 +265,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} # 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 @@ -325,7 +309,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} - run: node run-tests.js -c 1 test/integration/production/test/index.test.js if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -349,7 +333,7 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -374,6 +358,6 @@ jobs: id: restore-build with: path: ./* - key: ${{ github.sha }} + key: $${{ runner.os }}-{{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} From 78f39d292cea53b9c28514857384b0890ffca726 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 15:56:24 -0400 Subject: [PATCH 02/26] fix --- .github/workflows/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 684cc42689..b53401ec45 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -96,7 +96,7 @@ jobs: id: cache-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} testBlitzPackages: name: Blitz - Test Packages @@ -110,7 +110,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} - name: Setup kernel to increase watchers if: matrix.os == 'ubuntu-latest' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p @@ -135,7 +135,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} # Needed to get cypress binary - run: yarn cypress install - name: Install sass @@ -163,7 +163,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} - run: ./check-pre-compiled.sh if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -184,7 +184,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} - run: node run-tests.js --timings --type unit -g 1/1 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -206,7 +206,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} # 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 @@ -238,7 +238,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} # 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 @@ -265,7 +265,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} # 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 @@ -309,7 +309,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} - run: node run-tests.js -c 1 test/integration/production/test/index.test.js if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -333,7 +333,7 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -358,6 +358,6 @@ jobs: id: restore-build with: path: ./* - key: $${{ runner.os }}-{{ github.sha }} + key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} From 0f00214c6c7f1d50b4bf6a79916788690db22b3f Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 15:58:28 -0400 Subject: [PATCH 03/26] fix --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b53401ec45..5efa33282d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -195,6 +195,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 From fa527784122e7d997581595c78b73c377cc214f5 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 17:39:38 -0400 Subject: [PATCH 04/26] clean up --- .github/workflows/main.yml | 79 +------------------------------------- 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5efa33282d..b1cb468149 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,7 +54,8 @@ jobs: name: Build strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] + # os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} env: NEXT_TELEMETRY_DISABLED: 1 @@ -92,11 +93,6 @@ jobs: run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') id: docs-change - run: echo ${{steps.docs-change.outputs.DOCS_CHANGE}} - - uses: actions/cache@v2 - id: cache-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} testBlitzPackages: name: Blitz - Test Packages @@ -105,12 +101,6 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - name: Setup kernel to increase watchers if: matrix.os == 'ubuntu-latest' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p @@ -130,12 +120,6 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} # Needed to get cypress binary - run: yarn cypress install - name: Install sass @@ -158,12 +142,6 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - run: ./check-pre-compiled.sh if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -179,13 +157,6 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - - run: node run-tests.js --timings --type unit -g 1/1 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -201,18 +172,6 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: - - run: echo ${{needs.build.outputs.docsChange}} - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - - # 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 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - - run: xvfb-run node nextjs/run-tests.js -c 3 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -232,15 +191,6 @@ jobs: matrix: group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] steps: - - run: echo ${{needs.build.outputs.docsChange}} - working-directory: ./ - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - # 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 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -261,13 +211,6 @@ jobs: HEADLESS: true TEST_ELECTRON: 1 steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - # 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 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -305,12 +248,6 @@ jobs: BROWSER_NAME: "firefox" NEXT_TELEMETRY_DISABLED: 1 steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - run: node run-tests.js -c 1 test/integration/production/test/index.test.js if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -329,12 +266,6 @@ jobs: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -354,11 +285,5 @@ jobs: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} steps: - - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - id: restore-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} From 68a5b46f8aa4487d312509d71800fb50183a61db Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 17:46:46 -0400 Subject: [PATCH 05/26] Revert "clean up" This reverts commit fa527784122e7d997581595c78b73c377cc214f5. --- .github/workflows/main.yml | 79 +++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b1cb468149..5efa33282d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,8 +54,7 @@ jobs: name: Build strategy: matrix: - os: [ubuntu-latest] - # os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} env: NEXT_TELEMETRY_DISABLED: 1 @@ -93,6 +92,11 @@ jobs: run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') id: docs-change - run: echo ${{steps.docs-change.outputs.DOCS_CHANGE}} + - uses: actions/cache@v2 + id: cache-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} testBlitzPackages: name: Blitz - Test Packages @@ -101,6 +105,12 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} - name: Setup kernel to increase watchers if: matrix.os == 'ubuntu-latest' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p @@ -120,6 +130,12 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} # Needed to get cypress binary - run: yarn cypress install - name: Install sass @@ -142,6 +158,12 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} - run: ./check-pre-compiled.sh if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -157,6 +179,13 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + - run: node run-tests.js --timings --type unit -g 1/1 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -172,6 +201,18 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: + - run: echo ${{needs.build.outputs.docsChange}} + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + # 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 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + - run: xvfb-run node nextjs/run-tests.js -c 3 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -191,6 +232,15 @@ jobs: matrix: group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] steps: + - run: echo ${{needs.build.outputs.docsChange}} + working-directory: ./ + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + # 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 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -211,6 +261,13 @@ jobs: HEADLESS: true TEST_ELECTRON: 1 steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + # 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 if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -248,6 +305,12 @@ jobs: BROWSER_NAME: "firefox" NEXT_TELEMETRY_DISABLED: 1 steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} - run: node run-tests.js -c 1 test/integration/production/test/index.test.js if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -266,6 +329,12 @@ jobs: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} @@ -285,5 +354,11 @@ jobs: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} steps: + - uses: actions/cache@v2 + if: ${{needs.build.outputs.docsChange != 'docs only change'}} + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js' if: ${{needs.build.outputs.docsChange != 'docs only change'}} From 7301b1f257a199ab58e82bf5d562c86f21949596 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 17:50:20 -0400 Subject: [PATCH 06/26] fixes --- .github/workflows/main.yml | 50 ++++++++------------------------------ 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5efa33282d..4b9b1e336e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,8 +58,6 @@ jobs: runs-on: ${{ matrix.os }} env: NEXT_TELEMETRY_DISABLED: 1 - outputs: - docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }} steps: - uses: actions/checkout@v2 with: @@ -87,11 +85,6 @@ jobs: run: yarn build - run: node run-tests.js --timings --write-timings -g 1/1 working-directory: nextjs - - name: Check docs only change - working-directory: nextjs - run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') - id: docs-change - - run: echo ${{steps.docs-change.outputs.DOCS_CHANGE}} - uses: actions/cache@v2 id: cache-build with: @@ -106,13 +99,12 @@ jobs: NEXT_TELEMETRY_DISABLED: 1 steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - name: Setup kernel to increase watchers - if: matrix.os == 'ubuntu-latest' + if: runner.os == 'Linux' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - name: Test Blitz Packages run: yarn testonly:packages @@ -131,7 +123,6 @@ jobs: NEXT_TELEMETRY_DISABLED: 1 steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* @@ -141,7 +132,7 @@ jobs: - name: Install sass run: yarn install -W sass - name: Setup kernel to increase watchers - if: matrix.os == 'ubuntu-latest' + if: runner.os == 'Linux' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - name: Test examples run: yarn testonly:examples @@ -159,13 +150,11 @@ jobs: NEXT_TELEMETRY_DISABLED: 1 steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - run: ./check-pre-compiled.sh - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testUnit: name: Nextjs - Test Unit @@ -180,14 +169,12 @@ jobs: HEADLESS: true steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - run: node run-tests.js --timings --type unit -g 1/1 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testIntegrationBlitz: name: Blitz - Test Integration @@ -201,20 +188,18 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: - - run: echo ${{needs.build.outputs.docsChange}} - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} # 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 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} + - name: Setup kernel to increase watchers + if: runner.os == 'Linux' + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - run: xvfb-run node nextjs/run-tests.js -c 3 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testIntegration: name: Nextjs - Test Integration @@ -232,21 +217,17 @@ jobs: matrix: group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] steps: - - run: echo ${{needs.build.outputs.docsChange}} - working-directory: ./ - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} # 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 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - + - name: Setup kernel to increase watchers + if: runner.os == 'Linux' + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/20 -c 3 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testElectron: name: Nextjs - Test Electron @@ -262,21 +243,16 @@ jobs: TEST_ELECTRON: 1 steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} # 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 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - + - name: Setup kernel to increase watchers + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - run: cd test/integration/with-electron/app && yarn - if: ${{needs.build.outputs.docsChange != 'docs only change'}} - - run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testsPass: name: thank you, next @@ -306,13 +282,11 @@ jobs: NEXT_TELEMETRY_DISABLED: 1 steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - run: node run-tests.js -c 1 test/integration/production/test/index.test.js - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testSafari: name: Nextjs - Test Safari (production) @@ -330,13 +304,11 @@ jobs: BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js' - if: ${{needs.build.outputs.docsChange != 'docs only change'}} testSafariOld: name: Nextjs - Test Safari 10.1 (nav) @@ -355,10 +327,8 @@ jobs: BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} steps: - uses: actions/cache@v2 - if: ${{needs.build.outputs.docsChange != 'docs only change'}} id: restore-build with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js' - if: ${{needs.build.outputs.docsChange != 'docs only change'}} From f506ff167f06cb789192ff2f8a45a66ec73477cb Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 17:55:15 -0400 Subject: [PATCH 07/26] more changes --- .github/workflows/main.yml | 96 +++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b9b1e336e..697bc65992 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,12 +50,47 @@ jobs: env: CI: true - build: - name: Build - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + build-linux: + name: Build (Linux) + runs-on: ubuntu-latest + env: + NEXT_TELEMETRY_DISABLED: 1 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 25 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: "14" + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache node_modules + id: yarn-cache + uses: actions/cache@v2 + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + **/node_modules + key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + - run: yarn install --frozen-lockfile --check-files + - name: Build Packages + run: yarn build + - run: node run-tests.js --timings --write-timings -g 1/1 + working-directory: nextjs + - uses: actions/cache@v2 + id: cache-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + build-win: + name: Build (Windows) + runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 steps: @@ -93,7 +128,7 @@ jobs: testBlitzPackages: name: Blitz - Test Packages - needs: build + needs: build-linux runs-on: ubuntu-latest env: NEXT_TELEMETRY_DISABLED: 1 @@ -114,7 +149,7 @@ jobs: testBlitzExamples: timeout-minutes: 30 name: Blitz - Test Example Apps - needs: build + needs: build-linux strategy: matrix: os: [ubuntu-latest, windows-latest] @@ -145,7 +180,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: build + needs: build-linux env: NEXT_TELEMETRY_DISABLED: 1 steps: @@ -162,7 +197,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: build + needs: build-linux env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -177,12 +212,31 @@ jobs: - run: node run-tests.js --timings --type unit -g 1/1 testIntegrationBlitz: - name: Blitz - Test Integration - needs: build - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + name: Blitz - Test Integration (Linux) + needs: build-linux + runs-on: ubuntu-latest + env: + NEXT_TELEMETRY_DISABLED: 1 + NEXT_TEST_JOB: 1 + HEADLESS: true + steps: + - uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + + # TODO: remove after we fix watchpack watching too much + - name: Setup kernel to increase watchers + if: runner.os == 'Linux' + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p + + - run: xvfb-run node nextjs/run-tests.js -c 3 + + testIntegrationBlitzWin: + name: Blitz - Test Integration (Windows) + needs: build-win + runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -207,7 +261,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: build + needs: build-linux env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -235,7 +289,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: build + needs: build-linux env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -275,7 +329,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: build + needs: build-linux env: HEADLESS: true BROWSER_NAME: "firefox" @@ -294,7 +348,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: build + needs: build-linux env: BROWSERSTACK: true BROWSER_NAME: "safari" @@ -316,7 +370,7 @@ jobs: run: working-directory: nextjs runs-on: ubuntu-latest - needs: [build, testSafari] + needs: [build-linux, testSafari] env: BROWSERSTACK: true LEGACY_SAFARI: true From d68840357b0569f804a0841b35f50c4d0a68eee3 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 18:24:32 -0400 Subject: [PATCH 08/26] fix --- .github/workflows/main.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 697bc65992..59e83cc41b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: path: ./* key: ${{ runner.os }}-${{ github.sha }} - build-win: + build-windows: name: Build (Windows) runs-on: windows-latest env: @@ -235,7 +235,7 @@ jobs: testIntegrationBlitzWin: name: Blitz - Test Integration (Windows) - needs: build-win + needs: build-windows runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 @@ -247,13 +247,7 @@ jobs: with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - - # TODO: remove after we fix watchpack watching too much - - name: Setup kernel to increase watchers - if: runner.os == 'Linux' - run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - - run: xvfb-run node nextjs/run-tests.js -c 3 + - run: node nextjs/run-tests.js -c 3 testIntegration: name: Nextjs - Test Integration @@ -283,6 +277,26 @@ jobs: run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/20 -c 3 + testIntegrationWin: + name: Nextjs - Test Integration (Windows) + defaults: + run: + working-directory: nextjs + runs-on: windows-latest + needs: build-windows + env: + NEXT_TELEMETRY_DISABLED: 1 + NEXT_TEST_JOB: 1 + HEADLESS: true + steps: + - uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ github.sha }} + + - run: node run-tests.js test/integration/{basic,production,multi-pages}/test/index.test.js test/acceptance/*.test.js + testElectron: name: Nextjs - Test Electron defaults: @@ -316,6 +330,7 @@ jobs: checkPrecompiled, testIntegration, testIntegrationBlitz, + testIntegrationBlitzWin, testUnit, testBlitzPackages, testBlitzExamples, From c1e53d97f384a75646233c426a7b4eb77f1665ca Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 18:27:42 -0400 Subject: [PATCH 09/26] more fix --- .github/workflows/main.yml | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59e83cc41b..789e92eae8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -148,12 +148,9 @@ jobs: testBlitzExamples: timeout-minutes: 30 - name: Blitz - Test Example Apps + name: Blitz - Test Example Apps (Linux) needs: build-linux - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest env: NEXT_TELEMETRY_DISABLED: 1 steps: @@ -174,6 +171,28 @@ jobs: env: CI: true + testBlitzExamplesWin: + timeout-minutes: 30 + name: Blitz - Test Example Apps (Windows) + needs: build-windows + runs-on: windows-latest + env: + NEXT_TELEMETRY_DISABLED: 1 + steps: + - uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ runner.os }}-${{ github.sha }} + # Needed to get cypress binary + - run: yarn cypress install + - name: Install sass + run: yarn install -W sass + - name: Test examples + run: yarn testonly:examples + env: + CI: true + checkPrecompiled: name: Check Pre-compiled defaults: @@ -294,8 +313,7 @@ jobs: with: path: ./* key: ${{ github.sha }} - - - run: node run-tests.js test/integration/{basic,production,multi-pages}/test/index.test.js test/acceptance/*.test.js + - run: node run-tests.js test/integration/{basic,production,multi-pages}/test/index.test.js test/acceptance/*.test.js testElectron: name: Nextjs - Test Electron @@ -334,6 +352,7 @@ jobs: testUnit, testBlitzPackages, testBlitzExamples, + testBlitzExamplesWin, ] steps: - run: exit 0 From e7e02ef18e46e94b0397d2281bf003dbc7ca91f9 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 18:43:12 -0400 Subject: [PATCH 10/26] try diff approach --- .github/workflows/main.yml | 115 ++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 789e92eae8..b47a234200 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,7 @@ jobs: CI: true build-linux: - name: Build (Linux) + name: Build runs-on: ubuntu-latest env: NEXT_TELEMETRY_DISABLED: 1 @@ -88,44 +88,6 @@ jobs: path: ./* key: ${{ runner.os }}-${{ github.sha }} - build-windows: - name: Build (Windows) - runs-on: windows-latest - env: - NEXT_TELEMETRY_DISABLED: 1 - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 25 - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: "14" - - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Cache node_modules - id: yarn-cache - uses: actions/cache@v2 - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - **/node_modules - key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- - - run: yarn install --frozen-lockfile --check-files - - name: Build Packages - run: yarn build - - run: node run-tests.js --timings --write-timings -g 1/1 - working-directory: nextjs - - uses: actions/cache@v2 - id: cache-build - with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} - testBlitzPackages: name: Blitz - Test Packages needs: build-linux @@ -174,16 +136,31 @@ jobs: testBlitzExamplesWin: timeout-minutes: 30 name: Blitz - Test Example Apps (Windows) - needs: build-windows runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 steps: - - uses: actions/cache@v2 - id: restore-build + - name: Use Node.js + uses: actions/setup-node@v2 with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} + node-version: "14" + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache node_modules + id: yarn-cache + uses: actions/cache@v2 + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + **/node_modules + key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + - run: yarn install --frozen-lockfile --check-files + - name: Build Packages + run: yarn build # Needed to get cypress binary - run: yarn cypress install - name: Install sass @@ -254,18 +231,33 @@ jobs: testIntegrationBlitzWin: name: Blitz - Test Integration (Windows) - needs: build-windows runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 HEADLESS: true steps: - - uses: actions/cache@v2 - id: restore-build + - name: Use Node.js + uses: actions/setup-node@v2 with: - path: ./* - key: ${{ runner.os }}-${{ github.sha }} + node-version: "14" + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache node_modules + id: yarn-cache + uses: actions/cache@v2 + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + **/node_modules + key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + - run: yarn install --frozen-lockfile --check-files + - name: Build Packages + run: yarn build - run: node nextjs/run-tests.js -c 3 testIntegration: @@ -302,17 +294,32 @@ jobs: run: working-directory: nextjs runs-on: windows-latest - needs: build-windows env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 HEADLESS: true steps: - - uses: actions/cache@v2 - id: restore-build + - name: Use Node.js + uses: actions/setup-node@v2 with: - path: ./* - key: ${{ github.sha }} + node-version: "14" + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache node_modules + id: yarn-cache + uses: actions/cache@v2 + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + **/node_modules + key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + - run: yarn install --frozen-lockfile --check-files + - name: Build Packages + run: yarn build - run: node run-tests.js test/integration/{basic,production,multi-pages}/test/index.test.js test/acceptance/*.test.js testElectron: From 5ce3c1480a1708090c98852b5191a2aea0c1ec37 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 18:44:58 -0400 Subject: [PATCH 11/26] fix --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b47a234200..a5c811e974 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -140,6 +140,9 @@ jobs: env: NEXT_TELEMETRY_DISABLED: 1 steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 25 - name: Use Node.js uses: actions/setup-node@v2 with: @@ -237,6 +240,9 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 25 - name: Use Node.js uses: actions/setup-node@v2 with: @@ -299,6 +305,9 @@ jobs: NEXT_TEST_JOB: 1 HEADLESS: true steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 25 - name: Use Node.js uses: actions/setup-node@v2 with: From ad007dd261c1749a8a33eb74717e037619ee88a1 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 19:03:15 -0400 Subject: [PATCH 12/26] fix workflow --- .github/workflows/main.yml | 82 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5c811e974..185a97b7af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -148,19 +148,19 @@ jobs: with: node-version: "14" - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Cache node_modules - id: yarn-cache - uses: actions/cache@v2 - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - **/node_modules - key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + # - name: Get yarn cache directory path + # id: yarn-cache-dir-path + # run: echo "::set-output name=dir::$(yarn cache dir)" + # - name: Cache node_modules + # id: yarn-cache + # uses: actions/cache@v2 + # with: + # path: | + # ${{ steps.yarn-cache-dir-path.outputs.dir }} + # **/node_modules + # key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build @@ -248,19 +248,19 @@ jobs: with: node-version: "14" - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Cache node_modules - id: yarn-cache - uses: actions/cache@v2 - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - **/node_modules - key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + # - name: Get yarn cache directory path + # id: yarn-cache-dir-path + # run: echo "::set-output name=dir::$(yarn cache dir)" + # - name: Cache node_modules + # id: yarn-cache + # uses: actions/cache@v2 + # with: + # path: | + # ${{ steps.yarn-cache-dir-path.outputs.dir }} + # **/node_modules + # key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build @@ -296,9 +296,6 @@ jobs: testIntegrationWin: name: Nextjs - Test Integration (Windows) - defaults: - run: - working-directory: nextjs runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 @@ -313,23 +310,24 @@ jobs: with: node-version: "14" - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Cache node_modules - id: yarn-cache - uses: actions/cache@v2 - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - **/node_modules - key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- + # - name: Get yarn cache directory path + # id: yarn-cache-dir-path + # run: echo "::set-output name=dir::$(yarn cache dir)" + # - name: Cache node_modules + # id: yarn-cache + # uses: actions/cache@v2 + # with: + # path: | + # ${{ steps.yarn-cache-dir-path.outputs.dir }} + # **/node_modules + # key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-${{ runner.node_version}}-yarn-v13- - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build - run: node run-tests.js test/integration/{basic,production,multi-pages}/test/index.test.js test/acceptance/*.test.js + working-directory: nextjs testElectron: name: Nextjs - Test Electron From 4ff0958b8ec8a76f883c2d9aa331ffb71e09a88f Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 19:05:13 -0400 Subject: [PATCH 13/26] add debug logging --- nextjs/packages/next/server/lib/find-page-file.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nextjs/packages/next/server/lib/find-page-file.ts b/nextjs/packages/next/server/lib/find-page-file.ts index ee284560bf..49dff41e8b 100644 --- a/nextjs/packages/next/server/lib/find-page-file.ts +++ b/nextjs/packages/next/server/lib/find-page-file.ts @@ -24,15 +24,14 @@ export async function findPageFile( normalizedPagePath: string, pageExtensions: string[] ): Promise { - // console.log('[findPageFile]', { rootDir, normalizedPagePath }) - const page = denormalizePagePath(normalizedPagePath) + console.log('[findPageFile]', { rootDir, normalizedPagePath, page }) const allPages = await recursiveFindPages( rootDir, buildPageExtensionRegex(pageExtensions) ) - // console.log('allPages', allPages) + console.log('allPages', allPages) let prefix: string if (normalizedPagePath.startsWith('/api/')) { @@ -56,10 +55,10 @@ export async function findPageFile( new RegExp(`${prefix}${nameMatch}\\.(?:${pageExtensions.join('|')})$`) ) ) - // console.log( - // new RegExp(`${prefix}${nameMatch}\\.(?:${pageExtensions.join('|')})$`) - // ) - // console.log('FOUND', foundPagePaths) + console.log( + new RegExp(`${prefix}${nameMatch}\\.(?:${pageExtensions.join('|')})$`) + ) + console.log('FOUND', foundPagePaths) // for (const extension of pageExtensions) { // if (!normalizedPagePath.endsWith('/index')) { From 60e106ce3a5974785ba4dfe0986a1dcf03331928 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 20:06:20 -0400 Subject: [PATCH 14/26] fix the bug --- .github/workflows/main.yml | 2 +- .../next/server/lib/find-page-file.ts | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 185a97b7af..d5d9355f14 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -326,7 +326,7 @@ jobs: - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build - - run: node run-tests.js test/integration/{basic,production,multi-pages}/test/index.test.js test/acceptance/*.test.js + - run: node run-tests.js test/integration/basic/test/index.test.js test/integration/production/test/index.test.js test/integration/multi-pages/test/index.test.js test/acceptance/*.test.js working-directory: nextjs testElectron: diff --git a/nextjs/packages/next/server/lib/find-page-file.ts b/nextjs/packages/next/server/lib/find-page-file.ts index 49dff41e8b..824d35f8ce 100644 --- a/nextjs/packages/next/server/lib/find-page-file.ts +++ b/nextjs/packages/next/server/lib/find-page-file.ts @@ -2,7 +2,10 @@ import { join, sep as pathSeparator, normalize } from 'path' import chalk from 'chalk' import { warn } from '../../build/output/log' import { promises } from 'fs' -import { denormalizePagePath } from '../../next-server/server/normalize-page-path' +import { + denormalizePagePath, + normalizePathSep, +} from '../../next-server/server/normalize-page-path' // import { fileExists } from '../../lib/file-exists' import { recursiveFindPages } from '../../lib/recursive-readdir' import { buildPageExtensionRegex } from '../../build/utils' @@ -25,13 +28,13 @@ export async function findPageFile( pageExtensions: string[] ): Promise { const page = denormalizePagePath(normalizedPagePath) - console.log('[findPageFile]', { rootDir, normalizedPagePath, page }) + // console.log('[findPageFile]', { rootDir, normalizedPagePath, page }) const allPages = await recursiveFindPages( rootDir, buildPageExtensionRegex(pageExtensions) ) - console.log('allPages', allPages) + // console.log('allPages', allPages) let prefix: string if (normalizedPagePath.startsWith('/api/')) { @@ -49,16 +52,18 @@ export async function findPageFile( nameMatch = `(${page}|${page}/index)` } + // Make the regex work for dynamic routes like [...auth].ts nameMatch = nameMatch.replace(/[[\]\\]/g, '\\$&') + const foundPagePaths = allPages.filter((path) => - path.match( + normalizePathSep(path).match( new RegExp(`${prefix}${nameMatch}\\.(?:${pageExtensions.join('|')})$`) ) ) - console.log( - new RegExp(`${prefix}${nameMatch}\\.(?:${pageExtensions.join('|')})$`) - ) - console.log('FOUND', foundPagePaths) + // console.log( + // new RegExp(`${prefix}${nameMatch}\\.(?:${pageExtensions.join('|')})$`) + // ) + // console.log('FOUND', foundPagePaths) // for (const extension of pageExtensions) { // if (!normalizedPagePath.endsWith('/index')) { From 054400b85cb94f182054e15a691812b447ef5275 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 6 Jul 2021 20:51:54 -0400 Subject: [PATCH 15/26] fix --- .github/workflows/main.yml | 6 +++--- nextjs/packages/next/next-server/server/config-shared.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5d9355f14..64c9b75d72 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,7 +110,7 @@ jobs: testBlitzExamples: timeout-minutes: 30 - name: Blitz - Test Example Apps (Linux) + name: Blitz - Test Example Apps (ubuntu-latest) needs: build-linux runs-on: ubuntu-latest env: @@ -135,7 +135,7 @@ jobs: testBlitzExamplesWin: timeout-minutes: 30 - name: Blitz - Test Example Apps (Windows) + name: Blitz - Test Example Apps (windows-latest) runs-on: windows-latest env: NEXT_TELEMETRY_DISABLED: 1 @@ -211,7 +211,7 @@ jobs: - run: node run-tests.js --timings --type unit -g 1/1 testIntegrationBlitz: - name: Blitz - Test Integration (Linux) + name: Blitz - Test Integration needs: build-linux runs-on: ubuntu-latest env: diff --git a/nextjs/packages/next/next-server/server/config-shared.ts b/nextjs/packages/next/next-server/server/config-shared.ts index 43a60b3013..6f0dd4c714 100644 --- a/nextjs/packages/next/next-server/server/config-shared.ts +++ b/nextjs/packages/next/next-server/server/config-shared.ts @@ -163,8 +163,8 @@ export async function getConfigSrcPath(dir: string | null) { } else if (existsSync(jsPath)) { return jsPath } else if (existsSync(legacyPath)) { - const isInternalDevelopment = __dirname.includes( - 'packages/next/dist/next-server' + const isInternalDevelopment = __dirname.match( + '[\\/]packages[\\/]next[\\/]dist[\\/]next-server' ) if (isInternalDevelopment || process.env.VERCEL_BUILDER) { // We read from next.config.js that Vercel automatically adds From ad6e18ca8ef5abbec3e7c53a922a42c1cf76bc75 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 14:29:40 -0400 Subject: [PATCH 16/26] few more fixes --- .../packages/next/next-server/server/config-shared.ts | 2 +- nextjs/test/acceptance/ReactRefreshLogBox.dev.test.js | 10 +++++++++- test/integration/no-suspense/app/queries/getBasic.ts | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/nextjs/packages/next/next-server/server/config-shared.ts b/nextjs/packages/next/next-server/server/config-shared.ts index 6f0dd4c714..b8a490e41f 100644 --- a/nextjs/packages/next/next-server/server/config-shared.ts +++ b/nextjs/packages/next/next-server/server/config-shared.ts @@ -164,7 +164,7 @@ export async function getConfigSrcPath(dir: string | null) { return jsPath } else if (existsSync(legacyPath)) { const isInternalDevelopment = __dirname.match( - '[\\/]packages[\\/]next[\\/]dist[\\/]next-server' + /[\\/]packages[\\/]next[\\/]dist[\\/]next-server/ ) if (isInternalDevelopment || process.env.VERCEL_BUILDER) { // We read from next.config.js that Vercel automatically adds diff --git a/nextjs/test/acceptance/ReactRefreshLogBox.dev.test.js b/nextjs/test/acceptance/ReactRefreshLogBox.dev.test.js index 2ab9098060..52add49a44 100644 --- a/nextjs/test/acceptance/ReactRefreshLogBox.dev.test.js +++ b/nextjs/test/acceptance/ReactRefreshLogBox.dev.test.js @@ -1434,7 +1434,15 @@ test('server-side only compilation errors', async () => { try { await patch() } catch (error) { - await patch() + try { + await patch() + } catch (error) { + try { + await patch() + } catch (error) { + await patch() + } + } } expect(await session.hasRedbox(true)).toBe(true) diff --git a/test/integration/no-suspense/app/queries/getBasic.ts b/test/integration/no-suspense/app/queries/getBasic.ts index ff5bfaa2a0..c33d1d58d0 100644 --- a/test/integration/no-suspense/app/queries/getBasic.ts +++ b/test/integration/no-suspense/app/queries/getBasic.ts @@ -1,3 +1,6 @@ +import delay from "delay" + export default async function getBasic() { + await delay(100) return "basic-result" } From 939bffb75cd23c5d1c0745862a421e3eae5fe923 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 14:46:18 -0400 Subject: [PATCH 17/26] yet still more --- .github/workflows/main.yml | 9 ++++----- test/integration/no-suspense/app/queries/getBasic.ts | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64c9b75d72..637614728d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,7 +80,7 @@ jobs: - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build - - run: node run-tests.js --timings --write-timings -g 1/1 + - run: node run-tests.js -g 1/1 working-directory: nextjs - uses: actions/cache@v2 id: cache-build @@ -207,8 +207,7 @@ jobs: with: path: ./* key: ${{ runner.os }}-${{ github.sha }} - - - run: node run-tests.js --timings --type unit -g 1/1 + - run: node run-tests.js --type unit -g 1/1 testIntegrationBlitz: name: Blitz - Test Integration @@ -292,7 +291,7 @@ jobs: - name: Setup kernel to increase watchers if: runner.os == 'Linux' run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - - run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/20 -c 3 + - run: xvfb-run node run-tests.js -g ${{ matrix.group }}/20 -c 3 testIntegrationWin: name: Nextjs - Test Integration (Windows) @@ -326,7 +325,7 @@ jobs: - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build - - run: node run-tests.js test/integration/basic/test/index.test.js test/integration/production/test/index.test.js test/integration/multi-pages/test/index.test.js test/acceptance/*.test.js + - run: node run-tests.js test/integration/basic/test/index.test.js test/integration/production/test/index.test.js test/integration/multi-pages/test/index.test.js working-directory: nextjs testElectron: diff --git a/test/integration/no-suspense/app/queries/getBasic.ts b/test/integration/no-suspense/app/queries/getBasic.ts index c33d1d58d0..2a2bab2e3b 100644 --- a/test/integration/no-suspense/app/queries/getBasic.ts +++ b/test/integration/no-suspense/app/queries/getBasic.ts @@ -1,6 +1,6 @@ import delay from "delay" export default async function getBasic() { - await delay(100) + await delay(500) return "basic-result" } From 19ae84728a1a315c7e92f98a3fb8c366754f749d Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 14:53:48 -0400 Subject: [PATCH 18/26] oops --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 637614728d..288ba28611 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,8 +80,6 @@ jobs: - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build - - run: node run-tests.js -g 1/1 - working-directory: nextjs - uses: actions/cache@v2 id: cache-build with: From e7cd4f942180172ed0f36d4c4972455a4ba863d5 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 15:16:55 -0400 Subject: [PATCH 19/26] try? --- test/integration/misc/test/index.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/misc/test/index.test.ts b/test/integration/misc/test/index.test.ts index 1d36102a53..08fc6ca9bf 100644 --- a/test/integration/misc/test/index.test.ts +++ b/test/integration/misc/test/index.test.ts @@ -1,4 +1,5 @@ /* eslint-env jest */ +import delay from "delay" import fs from "fs-extra" import { blitzBuild, @@ -24,7 +25,10 @@ describe("Misc", () => { const prerender = ["/body-parser", "/script"] await Promise.all(prerender.map((route) => renderViaHTTP(context.appPort, route))) }) - afterAll(() => killApp(context.server)) + afterAll(async () => { + await killApp(context.server) + await delay(1000) + }) describe("body parser config", () => { it("should render query result", async () => { From 4840ca409d752815070ffe0ceecb9187ad47bc3d Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 16:33:28 -0400 Subject: [PATCH 20/26] hmm? --- .github/workflows/main.yml | 2 +- test/integration/misc/test/index.test.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 288ba28611..3298ad5e44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -261,7 +261,7 @@ jobs: - run: yarn install --frozen-lockfile --check-files - name: Build Packages run: yarn build - - run: node nextjs/run-tests.js -c 3 + - run: node nextjs/run-tests.js testIntegration: name: Nextjs - Test Integration diff --git a/test/integration/misc/test/index.test.ts b/test/integration/misc/test/index.test.ts index 08fc6ca9bf..1d36102a53 100644 --- a/test/integration/misc/test/index.test.ts +++ b/test/integration/misc/test/index.test.ts @@ -1,5 +1,4 @@ /* eslint-env jest */ -import delay from "delay" import fs from "fs-extra" import { blitzBuild, @@ -25,10 +24,7 @@ describe("Misc", () => { const prerender = ["/body-parser", "/script"] await Promise.all(prerender.map((route) => renderViaHTTP(context.appPort, route))) }) - afterAll(async () => { - await killApp(context.server) - await delay(1000) - }) + afterAll(() => killApp(context.server)) describe("body parser config", () => { it("should render query result", async () => { From 0e649d78c8e66ac3652daea699f02cfd78f01ad5 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 16:35:35 -0400 Subject: [PATCH 21/26] more --- test/integration/auth/test/index.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/auth/test/index.test.ts b/test/integration/auth/test/index.test.ts index 788278838b..cfc1524f61 100644 --- a/test/integration/auth/test/index.test.ts +++ b/test/integration/auth/test/index.test.ts @@ -114,6 +114,7 @@ const runTests = (mode: string) => { describe("prefetching", () => { it("should prefetch from the query cache #2281", async () => { const browser = await webdriver(appPort, "/prefetching") + await waitFor(100) await browser.waitForElementByCss("#content") const text = await browser.elementByCss("#content").text() expect(text).toMatch(/noauth-basic-result/) From 1ac5a2ac80dea149a841d4e8ee12a4b11c90e599 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 16:56:13 -0400 Subject: [PATCH 22/26] again --- test/integration/misc/test/index.test.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/integration/misc/test/index.test.ts b/test/integration/misc/test/index.test.ts index 1d36102a53..09b67e44cf 100644 --- a/test/integration/misc/test/index.test.ts +++ b/test/integration/misc/test/index.test.ts @@ -53,15 +53,11 @@ describe("Misc", () => { const outdir = join(appDir, "out") describe("blitz export", () => { - it("should build successfully", async () => { - await fs.remove(join(appDir, ".next")) - const {code} = await blitzBuild(appDir) - if (code !== 0) throw new Error(`build failed with status ${code}`) - }) - it("should export successfully", async () => { - const {code} = await blitzExport(appDir, {outdir}) + const {code} = await blitzBuild(appDir) if (code !== 0) throw new Error(`export failed with status ${code}`) + const {code: exportCode} = await blitzExport(appDir, {outdir}) + if (exportCode !== 0) throw new Error(`export failed with status ${exportCode}`) }) }) }) From f4bc7830b217fca49f54edf854cab9d18265dd95 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 17:32:35 -0400 Subject: [PATCH 23/26] maybe --- test/integration/misc/test/index.test.ts | 19 +++++++++---------- test/lib/blitz-test-utils.ts | 9 ++++----- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/test/integration/misc/test/index.test.ts b/test/integration/misc/test/index.test.ts index 09b67e44cf..ebfa9598c8 100644 --- a/test/integration/misc/test/index.test.ts +++ b/test/integration/misc/test/index.test.ts @@ -1,5 +1,4 @@ /* eslint-env jest */ -import fs from "fs-extra" import { blitzBuild, blitzExport, @@ -48,16 +47,16 @@ describe("Misc", () => { if (browser) await browser.close() }) }) +}) - const appDir = join(__dirname, "../") - const outdir = join(appDir, "out") +const appDir = join(__dirname, "../") +const outdir = join(appDir, "out") - describe("blitz export", () => { - it("should export successfully", async () => { - const {code} = await blitzBuild(appDir) - if (code !== 0) throw new Error(`export failed with status ${code}`) - const {code: exportCode} = await blitzExport(appDir, {outdir}) - if (exportCode !== 0) throw new Error(`export failed with status ${exportCode}`) - }) +describe("blitz export", () => { + it("should export successfully", async () => { + const {code} = await blitzBuild(appDir) + if (code !== 0) throw new Error(`export failed with status ${code}`) + const {code: exportCode} = await blitzExport(appDir, {outdir}) + if (exportCode !== 0) throw new Error(`export failed with status ${exportCode}`) }) }) diff --git a/test/lib/blitz-test-utils.ts b/test/lib/blitz-test-utils.ts index 848df83467..09ab75f257 100644 --- a/test/lib/blitz-test-utils.ts +++ b/test/lib/blitz-test-utils.ts @@ -202,12 +202,11 @@ export function runBlitzLaunchCommand( ...opts.env, } + const command = opts.blitzStart ? "start" : "dev" + console.log(`Running command "blitz ${command}" `) + return new Promise((resolve, reject) => { - const instance = spawn( - "node", - ["--no-deprecation", blitzBin, opts.blitzStart ? "start" : "dev", ...argv], - {cwd, env}, - ) + const instance = spawn("node", ["--no-deprecation", blitzBin, command, ...argv], {cwd, env}) let didResolve = false function handleStdout(data: Buffer) { From f07abb682a92faf06c729b49831d8a9060d1eac2 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 17:50:38 -0400 Subject: [PATCH 24/26] progress --- test/integration/misc/app/queries/getBasic.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/misc/app/queries/getBasic.ts b/test/integration/misc/app/queries/getBasic.ts index ff5bfaa2a0..35e38d575d 100644 --- a/test/integration/misc/app/queries/getBasic.ts +++ b/test/integration/misc/app/queries/getBasic.ts @@ -1,3 +1,6 @@ +import delay from "delay" + export default async function getBasic() { + await delay(250) return "basic-result" } From 575b1bb96e6e6d7e9e0e1e66947ff460135c506b Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 18:13:08 -0400 Subject: [PATCH 25/26] more fix --- test/integration/misc/app/queries/getError.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/misc/app/queries/getError.ts b/test/integration/misc/app/queries/getError.ts index 88519acfc1..4c0002c4ba 100644 --- a/test/integration/misc/app/queries/getError.ts +++ b/test/integration/misc/app/queries/getError.ts @@ -1,4 +1,7 @@ +import delay from "delay" + export default async function getError() { + await delay(250) return "should-not-succeed" } From 56bf718d9f3edafe309dbbc94a94bf1fa2c65cbe Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 7 Jul 2021 18:25:31 -0400 Subject: [PATCH 26/26] ugh --- test/integration/misc/app/queries/getError.ts | 2 +- test/integration/misc/test/index.test.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/integration/misc/app/queries/getError.ts b/test/integration/misc/app/queries/getError.ts index 4c0002c4ba..d8a9ae012c 100644 --- a/test/integration/misc/app/queries/getError.ts +++ b/test/integration/misc/app/queries/getError.ts @@ -1,7 +1,7 @@ import delay from "delay" export default async function getError() { - await delay(250) + await delay(10) return "should-not-succeed" } diff --git a/test/integration/misc/test/index.test.ts b/test/integration/misc/test/index.test.ts index ebfa9598c8..bf8ac88caf 100644 --- a/test/integration/misc/test/index.test.ts +++ b/test/integration/misc/test/index.test.ts @@ -26,12 +26,10 @@ describe("Misc", () => { afterAll(() => killApp(context.server)) describe("body parser config", () => { - it("should render query result", async () => { + it("should not render query result", async () => { const browser = await webdriver(context.appPort, "/body-parser") - let text = await browser.elementByCss("#page").text() - expect(text).toMatch(/Loading/) await browser.waitForElementByCss("#error") - text = await browser.elementByCss("#error").text() + let text = await browser.elementByCss("#error").text() expect(text).toMatch(/query failed/) if (browser) await browser.close() })