[tests] Add support for probes.json (#8279)

Previously, our test fixtures used to use a probes prop in `vercel.json` that was removed right before it was deployed.

This PR allows a separate `probes.json` file with the same content to separate the test fixture input from the test probes.

This allows us to test real "zero config" deployments without a `vercel.json` file.
This commit is contained in:
Steven
2022-08-03 20:15:50 -04:00
committed by GitHub
parent 2b101d4692
commit bfc553db11
196 changed files with 120 additions and 4305 deletions

View File

@@ -9,7 +9,7 @@ const ms = require('ms');
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
async function nowDeploy(bodies, randomness, uploadNowJson) {
async function nowDeploy(projectName, bodies, randomness, uploadNowJson) {
const files = Object.keys(bodies)
.filter(n =>
uploadNowJson
@@ -29,9 +29,11 @@ async function nowDeploy(bodies, randomness, uploadNowJson) {
(path.extname(n) === '.sh' ? 0o100755 : 0o100644),
}));
const { FORCE_BUILD_IN_REGION, NOW_DEBUG, VERCEL_DEBUG, VERCEL_CLI_VERSION } =
const { FORCE_BUILD_IN_REGION, VERCEL_DEBUG, VERCEL_CLI_VERSION } =
process.env;
const nowJson = JSON.parse(bodies['vercel.json'] || bodies['now.json']);
const nowJson = JSON.parse(
bodies['vercel.json'] || bodies['now.json'] || '{}'
);
delete nowJson.probes;
@@ -44,13 +46,12 @@ async function nowDeploy(bodies, randomness, uploadNowJson) {
...(nowJson.build || {}).env,
RANDOMNESS_BUILD_ENV_VAR: randomness,
FORCE_BUILD_IN_REGION,
NOW_DEBUG,
VERCEL_DEBUG,
VERCEL_CLI_VERSION,
NEXT_TELEMETRY_DISABLED: '1',
},
},
name: 'test2020',
name: projectName,
files,
meta: {},
...nowJson,