mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 12:57:46 +00:00
[tests] Update tests to run with vercel cli tarball (#8257)
This PR update the tests suite to wait for Vercel CLI tarball and then use that tarball to run E2E tests. This is valuable because it will package all the packages in this monorepo to make the tests follow more closely what will happen in production once merged. Since the current "Find Changes" step takes about 2 minutes, we run that first (it happens concurrently with the tarball preparation). Then once we complete "Find Changes" we wait for the tarball but it will likely be ready by that point since it also takes about 2 minutes. After both of those steps, the E2E tests continue as usual but with the `VERCEL_CLI_VERSION` set to the tarball. - Related to #7967 - Closes #8245 - Closes #8227
This commit is contained in:
@@ -33,6 +33,8 @@ async function nowDeploy(bodies, randomness, uploadNowJson) {
|
||||
process.env;
|
||||
const nowJson = JSON.parse(bodies['vercel.json'] || bodies['now.json']);
|
||||
|
||||
delete nowJson.probes;
|
||||
|
||||
const nowDeployPayload = {
|
||||
version: 2,
|
||||
public: true,
|
||||
@@ -50,16 +52,10 @@ async function nowDeploy(bodies, randomness, uploadNowJson) {
|
||||
},
|
||||
name: 'test2020',
|
||||
files,
|
||||
builds: nowJson.builds,
|
||||
meta: {},
|
||||
...nowJson,
|
||||
};
|
||||
|
||||
for (const field of ['routes', 'rewrites', 'headers', 'redirects']) {
|
||||
if (nowJson[field]) {
|
||||
nowDeployPayload[field] = nowJson[field];
|
||||
}
|
||||
}
|
||||
|
||||
logWithinTest(`posting ${files.length} files`);
|
||||
|
||||
for (const { file: filename } of files) {
|
||||
@@ -146,7 +142,7 @@ async function filePost(body, digest) {
|
||||
}
|
||||
|
||||
async function deploymentPost(payload) {
|
||||
const url = '/v6/now/deployments?forceNew=1';
|
||||
const url = '/v13/deployments?skipAutoDetectionConfirmation=1&forceNew=1';
|
||||
const resp = await fetchWithAuth(url, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
@@ -164,7 +160,7 @@ async function deploymentPost(payload) {
|
||||
}
|
||||
|
||||
async function deploymentGet(deploymentId) {
|
||||
const url = `/v12/now/deployments/${deploymentId}`;
|
||||
const url = `/v13/deployments/${deploymentId}`;
|
||||
logWithinTest('fetching deployment', url);
|
||||
const resp = await fetchWithAuth(url);
|
||||
const json = await resp.json();
|
||||
|
||||
Reference in New Issue
Block a user