@reddoorla/maintenance 0.78.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YSPA5AUT.js → chunk-3LWKIKZ2.js} +33 -5
- package/dist/{chunk-YSPA5AUT.js.map → chunk-3LWKIKZ2.js.map} +1 -1
- package/dist/chunk-A3WDWNN5.js +70 -0
- package/dist/chunk-A3WDWNN5.js.map +1 -0
- package/dist/{chunk-GWAOX3CU.js → chunk-FAQIMC26.js} +2 -2
- package/dist/cli/bin.js +2 -2
- package/dist/cli/commands/audit.js +3 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/forms/index.js +6 -62
- package/dist/forms/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/{init-KF4QHMWQ.js → init-Y5O33BUL.js} +5 -3
- package/dist/{init-KF4QHMWQ.js.map → init-Y5O33BUL.js.map} +1 -1
- package/dist/{launch-CVCIP5NU.js → launch-3SYLX263.js} +4 -2
- package/dist/{launch-CVCIP5NU.js.map → launch-3SYLX263.js.map} +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-GWAOX3CU.js.map → chunk-FAQIMC26.js.map} +0 -0
|
@@ -10,6 +10,9 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
defaultSpawn
|
|
12
12
|
} from "./chunk-HVOOCK6L.js";
|
|
13
|
+
import {
|
|
14
|
+
INGEST_TIMEOUT_MS
|
|
15
|
+
} from "./chunk-A3WDWNN5.js";
|
|
13
16
|
import {
|
|
14
17
|
siteLabel
|
|
15
18
|
} from "./chunk-XXTZBPUY.js";
|
|
@@ -2024,6 +2027,18 @@ async function smokeAudit(ctx) {
|
|
|
2024
2027
|
// src/audits/form-e2e.ts
|
|
2025
2028
|
var CF_TEST_SITEKEY = "1x00000000000000000000AA";
|
|
2026
2029
|
var CONTACT_PATHS = ["/contact", "/"];
|
|
2030
|
+
var TESTMODE_SKIPPED_WORK_MS = 1e3;
|
|
2031
|
+
var BUDGET_WARN_RATIO = 0.5;
|
|
2032
|
+
function projectRealSubmissionMs(probeElapsedMs) {
|
|
2033
|
+
return probeElapsedMs + TESTMODE_SKIPPED_WORK_MS;
|
|
2034
|
+
}
|
|
2035
|
+
function isIngestBudgetThin(probeElapsedMs, budgetMs = INGEST_TIMEOUT_MS) {
|
|
2036
|
+
return projectRealSubmissionMs(probeElapsedMs) > budgetMs * BUDGET_WARN_RATIO;
|
|
2037
|
+
}
|
|
2038
|
+
function budgetThinSummary(probeElapsedMs) {
|
|
2039
|
+
const s = (ms) => `${(ms / 1e3).toFixed(1)}s`;
|
|
2040
|
+
return `BUDGET_THIN: probe ${s(probeElapsedMs)} + ~${s(TESTMODE_SKIPPED_WORK_MS)} of sink work the probe skips \u2248 ${s(projectRealSubmissionMs(probeElapsedMs))} projected against a ${s(INGEST_TIMEOUT_MS)} abort budget \u2014 a real submission may be reported to the visitor as failed while central still captures the lead`;
|
|
2041
|
+
}
|
|
2027
2042
|
var LIVE_ENV_VAR = "REDDOOR_FORM_E2E_LIVE";
|
|
2028
2043
|
function liveRunnerEnabled(env = process.env) {
|
|
2029
2044
|
return env[LIVE_ENV_VAR] === "1" || env[LIVE_ENV_VAR] === "true";
|
|
@@ -2069,12 +2084,23 @@ async function formE2eAudit(ctx) {
|
|
|
2069
2084
|
};
|
|
2070
2085
|
}
|
|
2071
2086
|
const ok = outcome.success ? "pass" : "fail";
|
|
2087
|
+
const details = { ok, formPresent: true, checkedAt };
|
|
2088
|
+
if (!outcome.success) {
|
|
2089
|
+
return {
|
|
2090
|
+
audit: "form-e2e",
|
|
2091
|
+
site: label,
|
|
2092
|
+
status: "warn",
|
|
2093
|
+
summary: `form-e2e: synthetic submission failed${outcome.detail ? ` \u2014 ${outcome.detail}` : ""}`,
|
|
2094
|
+
details
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
const thin = typeof outcome.elapsedMs === "number" && isIngestBudgetThin(outcome.elapsedMs) ? budgetThinSummary(outcome.elapsedMs) : null;
|
|
2072
2098
|
return {
|
|
2073
2099
|
audit: "form-e2e",
|
|
2074
2100
|
site: label,
|
|
2075
|
-
status:
|
|
2076
|
-
summary:
|
|
2077
|
-
details
|
|
2101
|
+
status: thin ? "warn" : "pass",
|
|
2102
|
+
summary: thin ? `form-e2e: synthetic submission succeeded \u2014 ${thin}` : "form-e2e: synthetic submission succeeded",
|
|
2103
|
+
details
|
|
2078
2104
|
};
|
|
2079
2105
|
} finally {
|
|
2080
2106
|
await runner.close?.();
|
|
@@ -2154,9 +2180,11 @@ async function defaultFormRunner() {
|
|
|
2154
2180
|
const postResponse = page.waitForResponse((r) => r.request().method() === "POST", {
|
|
2155
2181
|
timeout: PAGE_TIMEOUT_MS2
|
|
2156
2182
|
}).catch(() => null);
|
|
2183
|
+
const startedAt = Date.now();
|
|
2157
2184
|
await page.locator('button[type="submit"], input[type="submit"]').first().click({ timeout: PAGE_TIMEOUT_MS2 });
|
|
2158
2185
|
const ok = await page.locator('[role="status"]').first().waitFor({ state: "visible", timeout: PAGE_TIMEOUT_MS2 }).then(() => true).catch(() => false);
|
|
2159
|
-
|
|
2186
|
+
const elapsedMs = Date.now() - startedAt;
|
|
2187
|
+
if (ok) return { formPresent: true, success: true, elapsedMs };
|
|
2160
2188
|
const actionResp = await postResponse;
|
|
2161
2189
|
const alertText = await page.locator('[role="alert"]').first().textContent({ timeout: 1e3 }).catch(() => null);
|
|
2162
2190
|
const respBit = actionResp ? `POST ${actionResp.status()}${actionResp.status() >= 400 ? ` ${(await actionResp.text().catch(() => "")).slice(0, 80)}` : ""}` : "no POST observed";
|
|
@@ -2232,4 +2260,4 @@ export {
|
|
|
2232
2260
|
runAudits,
|
|
2233
2261
|
runAuditsAcross
|
|
2234
2262
|
};
|
|
2235
|
-
//# sourceMappingURL=chunk-
|
|
2263
|
+
//# sourceMappingURL=chunk-3LWKIKZ2.js.map
|