From 51637d3068f629e6bbcc5a2aeb44043f2699e6ba Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sat, 24 Dec 2022 16:29:46 +0100 Subject: [PATCH 1/2] test: add windows e2e tests for app dir --- .github/workflows/build_test_deploy.yml | 114 ++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 78cda89e67e36..f0e6fd257a1e5 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -371,6 +371,68 @@ jobs: path: | test/traces + testAppDirWindowsDevE2E: + name: Test App Dir Windows Development (E2E) + runs-on: windows-latest + needs: [build, build-native-test] + timeout-minutes: 35 + env: + NEXT_TELEMETRY_DISABLED: 1 + NEXT_TEST_JOB: 1 + TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} + strategy: + fail-fast: false + matrix: + node: [16, 18] + group: [1, 2, 3, 4, 5, 6, 7] + steps: + - run: echo ${{needs.build.outputs.docsChange}} + + # https://github.com/actions/virtual-environments/issues/1187 + - name: tune linux network + run: sudo ethtool -K eth0 tx off rx off + + - uses: actions/cache@v3 + if: ${{needs.build.outputs.docsChange == 'nope'}} + id: restore-build + with: + path: ./* + key: ${{ github.sha }}-${{ github.run_number }} + + - uses: actions/download-artifact@v3 + if: ${{needs.build.outputs.docsChange == 'nope'}} + with: + name: next-swc-test-binary + path: packages/next-swc/native + + - run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-focal /bin/bash -c "cd /work && ls && curl https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/7 "test/e2e/app-dir/**/*.test.ts" >> /proc/1/fd/1" + name: Run test/e2e (dev) + if: ${{needs.build.outputs.docsChange == 'nope'}} + env: + NEXT_TEST_MODE: dev + # RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDevE2E / Group ${{ matrix.group }} / Node ${{ matrix.node }} + # RECORD_ALL_CONTENT: 1 + # RECORD_REPLAY: 1 + # RECORD_REPLAY_TEST_METRICS: 1 + # RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }} + + # - uses: replayio/action-upload@v0.4.5 + # if: always() + # with: + # api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti + # public: true + # filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }} + + - name: Upload test trace + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-trace + if-no-files-found: ignore + retention-days: 2 + path: | + test/traces + testProd: name: Test Production runs-on: ubuntu-latest @@ -473,6 +535,58 @@ jobs: # public: true # filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }} + testAppDirWindowsProdE2E: + name: Test App Dir Windows Production (E2E) + runs-on: windows-latest + needs: [build, build-native-test] + timeout-minutes: 35 + env: + NEXT_TELEMETRY_DISABLED: 1 + NEXT_TEST_JOB: 1 + TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} + strategy: + fail-fast: false + matrix: + node: [16, 18] + group: [1, 2, 3, 4] + steps: + - run: echo ${{needs.build.outputs.docsChange}} + + # https://github.com/actions/virtual-environments/issues/1187 + - name: tune linux network + run: sudo ethtool -K eth0 tx off rx off + + - uses: actions/cache@v3 + if: ${{needs.build.outputs.docsChange == 'nope'}} + id: restore-build + with: + path: ./* + key: ${{ github.sha }}-${{ github.run_number }} + + - uses: actions/download-artifact@v3 + if: ${{needs.build.outputs.docsChange == 'nope'}} + with: + name: next-swc-test-binary + path: packages/next-swc/native + + - run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-focal /bin/bash -c "cd /work && ls && curl https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/7 "test/e2e/app-dir/**/*.test.ts" >> /proc/1/fd/1" + name: Run test/e2e (production) + if: ${{needs.build.outputs.docsChange == 'nope'}} + env: + NEXT_TEST_MODE: start + # RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testProdE2E / Group ${{ matrix.group }} / Node ${{ matrix.node }} + # RECORD_ALL_CONTENT: 1 + # RECORD_REPLAY: 1 + # RECORD_REPLAY_TEST_METRICS: 1 + # RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }} + + # - uses: replayio/action-upload@v0.4.5 + # if: always() + # with: + # api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti + # public: true + # filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }} + testIntegration: name: Test Integration runs-on: ubuntu-latest From 2c5ff644cc9ae7dfc4611a60aef26eb153f58112 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 26 Dec 2022 21:59:42 +0100 Subject: [PATCH 2/2] rm tuning network --- .github/workflows/build_test_deploy.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index f0e6fd257a1e5..b2cf234512ec8 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -388,10 +388,6 @@ jobs: steps: - run: echo ${{needs.build.outputs.docsChange}} - # https://github.com/actions/virtual-environments/issues/1187 - - name: tune linux network - run: sudo ethtool -K eth0 tx off rx off - - uses: actions/cache@v3 if: ${{needs.build.outputs.docsChange == 'nope'}} id: restore-build @@ -552,10 +548,6 @@ jobs: steps: - run: echo ${{needs.build.outputs.docsChange}} - # https://github.com/actions/virtual-environments/issues/1187 - - name: tune linux network - run: sudo ethtool -K eth0 tx off rx off - - uses: actions/cache@v3 if: ${{needs.build.outputs.docsChange == 'nope'}} id: restore-build