Unverified Commit 9c31bbda authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[ci] Use commit instead of PR number for preview builds in deploy tests (#90722)

parent 4e6beadc
...@@ -783,7 +783,6 @@ jobs: ...@@ -783,7 +783,6 @@ jobs:
afterBuild: | afterBuild: |
export NEXT_E2E_TEST_TIMEOUT=240000 export NEXT_E2E_TEST_TIMEOUT=240000
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export GH_PR_NUMBER=${{ github.event.pull_request && github.event.pull_request.number || '' }}
node scripts/test-new-tests.mjs \ node scripts/test-new-tests.mjs \
--mode deploy \ --mode deploy \
--group ${{ matrix.group }} --group ${{ matrix.group }}
...@@ -817,7 +816,6 @@ jobs: ...@@ -817,7 +816,6 @@ jobs:
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true
export NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json,test/cache-components-tests-manifest.json" export NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json,test/cache-components-tests-manifest.json"
export NEXT_E2E_TEST_TIMEOUT=240000 export NEXT_E2E_TEST_TIMEOUT=240000
export GH_PR_NUMBER=${{ github.event.pull_request && github.event.pull_request.number || '' }}
node scripts/test-new-tests.mjs \ node scripts/test-new-tests.mjs \
--mode deploy \ --mode deploy \
--group ${{ matrix.group }} --group ${{ matrix.group }}
......
...@@ -85,15 +85,14 @@ async function main() { ...@@ -85,15 +85,14 @@ async function main() {
} }
const RUN_TESTS_ARGS = ['run-tests.js', '-c', '1', '--retries', '0'] const RUN_TESTS_ARGS = ['run-tests.js', '-c', '1', '--retries', '0']
const PR_NUMBER = process.env.GH_PR_NUMBER
// Only override the test version for deploy tests, as they need to run against // Only override the test version for deploy tests, as they need to run against
// the artifacts for the pull request. Otherwise, we don't need to specify this property, // the artifacts for the pull request. Otherwise, we don't need to specify this property,
// as tests will run against the local version of Next.js // as tests will run against the local version of Next.js.
// Always use the commit SHA endpoint to avoid GitHub API rate limits on the
// PR number endpoint (which resolves the PR to a SHA on every request).
const nextTestVersion = const nextTestVersion =
testMode === 'deploy' testMode === 'deploy'
? PR_NUMBER ? `https://vercel-packages.vercel.app/next/commits/${commitSha}/next`
? `https://vercel-packages.vercel.app/next/prs/${PR_NUMBER}/next`
: `https://vercel-packages.vercel.app/next/commits/${commitSha}/next`
: undefined : undefined
if (nextTestVersion) { if (nextTestVersion) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment