From f22965d8fb165f25b55fcd4f226fdbe35024d633 Mon Sep 17 00:00:00 2001 From: Janka Uryga Date: Tue, 3 Sep 2024 19:52:00 +0200 Subject: [PATCH] ci: try overriding the next swc version for deploy tests --- .github/workflows/test_e2e_deploy_release.yml | 8 +++++++- test/lib/next-modes/base.ts | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_e2e_deploy_release.yml b/.github/workflows/test_e2e_deploy_release.yml index bf145ea2c0520..0d1a5a6f6468b 100644 --- a/.github/workflows/test_e2e_deploy_release.yml +++ b/.github/workflows/test_e2e_deploy_release.yml @@ -48,7 +48,13 @@ jobs: matrix: group: [1/5, 2/5, 3/5, 4/5, 5/5, 6/6] with: - afterBuild: NEXT_TEST_MODE=deploy NEXT_TEST_VERSION="https://vercel-packages.vercel.app/next/commits/${{ github.sha }}/next" NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json" node run-tests.js --timings -g ${{ matrix.group }} -c 2 --type e2e + afterBuild: >- + NEXT_TEST_MODE=deploy + NEXT_TEST_VERSION="https://vercel-packages.vercel.app/next/commits/${{ github.sha }}/next" + NEXT_TEST_SWC_PACKAGE_NAME="@next/swc-linux-x64-gnu" + NEXT_TEST_SWC_PACKAGE_VERSION="https://vercel-packages.vercel.app/next/commits/${{ github.sha }}/@next/swc-linux-x64-gnu" + NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json" + node run-tests.js --timings -g ${{ matrix.group }} -c 2 --type e2e skipNativeBuild: 'yes' stepName: 'test-deploy-${{ matrix.group }}' timeout_minutes: 180 diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts index ec50125d51d66..82249bae675e3 100644 --- a/test/lib/next-modes/base.ts +++ b/test/lib/next-modes/base.ts @@ -172,6 +172,14 @@ export class NextInstance { if (skipInstall || skipIsolatedNext) { const pkgScripts = (this.packageJson['scripts'] as {}) || {} + const nextSwcOverride = + process.env.NEXT_TEST_SWC_PACKAGE_NAME && + process.env.NEXT_TEST_SWC_PACKAGE_VERSION + ? { + [process.env.NEXT_TEST_SWC_PACKAGE_NAME]: + process.env.NEXT_TEST_SWC_PACKAGE_VERSION, + } + : undefined await fs.mkdir(this.testDir, { recursive: true }) await fs.writeFile( path.join(this.testDir, 'package.json'), @@ -183,6 +191,7 @@ export class NextInstance { next: process.env.NEXT_TEST_VERSION || require('next/package.json').version, + ...nextSwcOverride, }, ...(this.resolutions ? { resolutions: this.resolutions } : {}), scripts: {