[tests] update python tests to use zero config (#9668)

This PR is some cleanup before splitting python e2e tests.

Changes:

- use `probes.json`
- use `/api` autodetection instead of `builds` array

---

I was also trying to figure out why these tests are so much faster when run locally (293s) vs. CI (1099s). I encountered issues trying to view the build logs for the deployments that are made.
This commit is contained in:
Sean Massa
2023-03-16 09:41:40 -05:00
committed by GitHub
parent 1c2ef37173
commit e210977a9c
62 changed files with 342 additions and 273 deletions

View File

@@ -116,7 +116,7 @@ async function runProbe(probe, deploymentId, deploymentUrl, ctx) {
deploymentId,
deploymentUrl,
deploymentLogs,
logLength: deploymentLogs.length,
logLength: deploymentLogs?.length,
});
throw new Error(
`Expected deployment logs of ${deploymentId} to contain ${toCheck}, it was not found`
@@ -242,11 +242,20 @@ async function runProbe(probe, deploymentId, deploymentUrl, ctx) {
return;
}
if (!actualArr?.length) {
throw new Error(
`Page ${probeUrl} does NOT contain response header "${header}", but probe says it should .\n\nActual: ${formatHeaders(
rawHeaders
)}`
);
}
if (!Array.isArray(expectedArr)) {
expectedArr = [expectedArr];
}
for (const expected of expectedArr) {
let isEqual = false;
for (const actual of actualArr) {
isEqual =
expected.startsWith('/') && expected.endsWith('/')