fix(doctor-tests): GOV-06-tester uppdaterade till running-truth (0pt#96:s prod-truth-fix; down+402/404 var den föråldrade paret; ok:false-next-to-200 är nu negativa-fallet)
CI (SIAX Cloud) / integration (push) Has been skipped
masterplan-lock / check (push) Successful in 4s
masterplan-lock / check (pull_request) Successful in 7s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 14s
CI (SIAX Cloud) / security (push) Successful in 15s
Security Scan (SIAX Cloud) / security (push) Successful in 16s
CI (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / integration (pull_request) Successful in 27s
CI (SIAX Cloud) / quality (pull_request) Successful in 33s
CI (SIAX Cloud) / quality (push) Successful in 53s
CI (SIAX Cloud) / integration (push) Has been skipped
masterplan-lock / check (push) Successful in 4s
masterplan-lock / check (pull_request) Successful in 7s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 14s
CI (SIAX Cloud) / security (push) Successful in 15s
Security Scan (SIAX Cloud) / security (push) Successful in 16s
CI (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / integration (pull_request) Successful in 27s
CI (SIAX Cloud) / quality (pull_request) Successful in 33s
CI (SIAX Cloud) / quality (push) Successful in 53s
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"control": "GOV-06",
|
||||
"operationalState": "running",
|
||||
"checkedAt": "2026-09-22T18:19:17Z",
|
||||
"checkedAt": "2026-09-22T19:08:50Z",
|
||||
"method": "scripts/siax-doctor.mjs --live --write-evidence (fetch, 15000ms timeout)",
|
||||
"probes": [
|
||||
{
|
||||
@@ -32,9 +32,9 @@
|
||||
"fqdn": "api.0pt.app",
|
||||
"env": "prod",
|
||||
"url": "https://api.0pt.app/api/health",
|
||||
"httpStatus": null,
|
||||
"ok": false,
|
||||
"note": "unreachable: fetch failed"
|
||||
"httpStatus": 200,
|
||||
"ok": true,
|
||||
"note": "server: unknown"
|
||||
}
|
||||
],
|
||||
"securityHeadersObserved": {
|
||||
|
||||
@@ -96,30 +96,35 @@ describe("GOV-06: a FALSE operationalState is detected (the historical defect)",
|
||||
for (const d of dirs) rmSync(d, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it("accepts the repo's real, honest pairing (down + 402/404) as the control", () => {
|
||||
it("accepts the repo's real, honest pairing (running + live 200/ready probes) as the control", () => {
|
||||
expect(gov06Failure(track(fixture(REAL_REPO, REAL_EVIDENCE)))).toBeNull();
|
||||
});
|
||||
|
||||
it('rejects operationalState "running" when the evidence was recorded for another state', () => {
|
||||
const detail = gov06Failure(track(fixture({ ...REAL_REPO, operationalState: "running" }, REAL_EVIDENCE)));
|
||||
expect(detail).toMatch(/running/);
|
||||
it("rejects operationalState 'down' when the evidence was recorded for 'running'", () => {
|
||||
const detail = gov06Failure(track(fixture({ ...REAL_REPO, operationalState: "down" }, REAL_EVIDENCE)));
|
||||
expect(detail).toMatch(/down/);
|
||||
expect(detail).toMatch(/operational-state\.json/);
|
||||
});
|
||||
|
||||
it('rejects operationalState "running" when the recorded probes are 402/404', () => {
|
||||
it('rejects operationalState "down" when the evidence was recorded for "running"', () => {
|
||||
const detail = gov06Failure(track(fixture({ ...REAL_REPO, operationalState: "down" }, REAL_EVIDENCE)));
|
||||
expect(detail).toMatch(/down/);
|
||||
expect(detail).toMatch(/operational-state\.json/);
|
||||
});
|
||||
|
||||
it('rejects operationalState "down" when the recorded probes are 200/ready', () => {
|
||||
const detail = gov06Failure(
|
||||
track(
|
||||
fixture(
|
||||
{ ...REAL_REPO, operationalState: "running" },
|
||||
{ ...REAL_EVIDENCE, operationalState: "running" },
|
||||
{ ...REAL_REPO, operationalState: "down" },
|
||||
{ ...REAL_EVIDENCE, operationalState: "down" },
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(detail).toMatch(/but the recorded probes say otherwise/);
|
||||
expect(detail).toMatch(/402|404/);
|
||||
expect(detail).toMatch(/but these prod hosts answered/);
|
||||
});
|
||||
|
||||
it("rejects an `ok: true` hand-written next to a non-2xx status", () => {
|
||||
it("rejects an `ok: false` hand-written next to a 2xx status", () => {
|
||||
const detail = gov06Failure(
|
||||
track(
|
||||
fixture(
|
||||
@@ -127,28 +132,31 @@ describe("GOV-06: a FALSE operationalState is detected (the historical defect)",
|
||||
{
|
||||
...REAL_EVIDENCE,
|
||||
operationalState: "running",
|
||||
probes: (REAL_EVIDENCE.probes as { ok: boolean }[]).map((p) => ({ ...p, ok: true })),
|
||||
probes: (REAL_EVIDENCE.probes as { ok: boolean; httpStatus: number }[]).map((p) => ({ ...p, ok: false })),
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(detail).toMatch(/records ok=true next to httpStatus/);
|
||||
expect(detail).toMatch(/records ok=false next to httpStatus/);
|
||||
});
|
||||
|
||||
it('rejects operationalState "down" when a prod host is recorded as answering', () => {
|
||||
it('rejects operationalState "running" when probes record 402/404 (the historical defect)', () => {
|
||||
const detail = gov06Failure(
|
||||
track(
|
||||
fixture(REAL_REPO, {
|
||||
...REAL_EVIDENCE,
|
||||
probes: (REAL_EVIDENCE.probes as { httpStatus: number; ok: boolean }[]).map((p) => ({
|
||||
...p,
|
||||
httpStatus: 200,
|
||||
ok: true,
|
||||
})),
|
||||
}),
|
||||
fixture(
|
||||
{ ...REAL_REPO, operationalState: "running" },
|
||||
{
|
||||
...REAL_EVIDENCE,
|
||||
probes: (REAL_EVIDENCE.probes as { httpStatus: number; ok: boolean }[]).map((p) => ({
|
||||
...p,
|
||||
httpStatus: 402,
|
||||
ok: false,
|
||||
})),
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(detail).toMatch(/"down" but these prod hosts answered/);
|
||||
expect(detail).toMatch(/but the recorded probes say otherwise/);
|
||||
});
|
||||
|
||||
it("rejects a liveness claim backed only by stale evidence", () => {
|
||||
|
||||
Reference in New Issue
Block a user