forgedock 1.65.0 → 1.67.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/bin/config-schema.mjs +2 -0
- package/bin/engine/outcome-codes.mjs +1 -0
- package/bin/engine-cli.mjs +143 -19
- package/bin/forgedock.mjs +7 -0
- package/bin/help-text.mjs +3 -3
- package/bin/introspect-schedule.mjs +98 -0
- package/bin/introspect-schedule.test.mjs +67 -0
- package/bin/lean/advisory.test.mjs +49 -0
- package/bin/lean/amendment-schema.mjs +31 -0
- package/bin/lean/attempts.mjs +159 -0
- package/bin/lean/attempts.test.mjs +127 -0
- package/bin/lean/basered.mjs +55 -0
- package/bin/lean/basered.test.mjs +68 -1
- package/bin/lean/batch-health.mjs +13 -5
- package/bin/lean/batch-health.test.mjs +16 -0
- package/bin/lean/batch.mjs +62 -0
- package/bin/lean/batch.test.mjs +119 -3
- package/bin/lean/capwait.mjs +14 -3
- package/bin/lean/capwait.test.mjs +20 -0
- package/bin/lean/clear-breaker.mjs +14 -0
- package/bin/lean/commentstate.mjs +41 -0
- package/bin/lean/commentstate.test.mjs +32 -0
- package/bin/lean/concurrency.mjs +89 -0
- package/bin/lean/concurrency.test.mjs +113 -0
- package/bin/lean/conformance.e2e.test.mjs +4 -2
- package/bin/lean/conformance.mjs +35 -3
- package/bin/lean/conformance.test.mjs +52 -0
- package/bin/lean/depcache.mjs +9 -0
- package/bin/lean/efficiency.mjs +162 -0
- package/bin/lean/efficiency.test.mjs +79 -0
- package/bin/lean/execution.mjs +31 -13
- package/bin/lean/execution.test.mjs +46 -0
- package/bin/lean/failure-stop.mjs +46 -0
- package/bin/lean/failure-stop.test.mjs +45 -0
- package/bin/lean/fixtures/capacity-storm.json +609 -0
- package/bin/lean/lean.mjs +130 -30
- package/bin/lean/lean.test.mjs +138 -47
- package/bin/lean/liveness.mjs +37 -0
- package/bin/lean/liveness.test.mjs +33 -0
- package/bin/lean/orchestrate-attempts.test.mjs +74 -0
- package/bin/lean/orchestrate-envhold.test.mjs +17 -0
- package/bin/lean/orchestrate-pause.test.mjs +84 -0
- package/bin/lean/orchestrate-reconcile.test.mjs +147 -0
- package/bin/lean/orchestrate.mjs +202 -28
- package/bin/lean/phaseledger.mjs +6 -0
- package/bin/lean/phaseledger.test.mjs +13 -1
- package/bin/lean/prompts.mjs +6 -10
- package/bin/lean/reconcile.mjs +90 -0
- package/bin/lean/recurrence.mjs +38 -2
- package/bin/lean/recurrence.test.mjs +56 -1
- package/bin/lean/sandbox-remote.mjs +33 -2
- package/bin/lean/sched.mjs +19 -0
- package/bin/lean/sched.test.mjs +11 -1
- package/bin/lean/schedd-health.mjs +8 -1
- package/bin/lean/schedd-health.test.mjs +19 -0
- package/bin/lean/schedd.mjs +97 -10
- package/bin/lean/schedd.test.mjs +138 -1
- package/bin/lean/slo.mjs +126 -0
- package/bin/lean/slo.test.mjs +112 -0
- package/bin/lean/statuscomment.mjs +37 -0
- package/bin/lean/statuscomment.test.mjs +48 -1
- package/bin/lean/verify.mjs +2 -1
- package/bin/pool/agent.mjs +46 -8
- package/bin/pool/cache-sweep.mjs +41 -4
- package/bin/pool/cli.mjs +28 -1
- package/bin/pool/health.mjs +18 -0
- package/bin/pool/lane-tools.mjs +21 -0
- package/bin/pool/mirror-seed.mjs +21 -2
- package/bin/pool/router.mjs +6 -2
- package/bin/stats/attempts.mjs +54 -0
- package/bin/stats/attempts.test.mjs +30 -0
- package/bin/stats/churn.mjs +49 -0
- package/bin/stats/churn.test.mjs +31 -0
- package/bin/stats/index.mjs +11 -3
- package/commands/orchestrate.md +21 -18
- package/docs/CONFIG.md +1 -0
- package/docs/OUTCOME-CODES.md +1 -0
- package/package.json +1 -1
- package/pool/image/entrypoint.sh +2 -1
- package/scripts/check-devdocs-freshness.sh +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
// #5975: a batch-level pause stops admission for every issue (dependency merge, engine/env re-admit, expiry), never a running lane.
|
|
4
|
+
import { describe, it } from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { orchestrate } from "./orchestrate.mjs";
|
|
7
|
+
|
|
8
|
+
const memStore = () => { let st = null; return { load: () => (st ? JSON.parse(JSON.stringify(st)) : null), save: (s) => { st = JSON.parse(JSON.stringify(s)); }, log: () => {} }; };
|
|
9
|
+
const EE = (detail) => ({ terminalReason: "engine-error", detail });
|
|
10
|
+
const MERGED = { terminalReason: "merged", pr: 9 };
|
|
11
|
+
const REC = { owner: "op@h", since: "2026-01-01T00:00:00.000Z", expiresAt: null, reason: "release cut", ownerPid: null, ownerHost: null };
|
|
12
|
+
|
|
13
|
+
// A fake clock: every sleep advances it, so polls and expiry run instantly.
|
|
14
|
+
const run = ({ script, issues, store = memStore(), pause = { v: null }, extra = {}, onStart = () => {}, onRow = () => {}, clock = { t: 1_000_000 } }) => {
|
|
15
|
+
const calls = [], updates = [], decisions = [];
|
|
16
|
+
const p = orchestrate({ issues, parallel: 1, pollMs: 1000, readBody: async (n) => (n === 2 ? "Blocked by #1" : ""), trusted: () => true, now: () => clock.t, store,
|
|
17
|
+
sleep: async (ms) => { clock.t += Math.max(1, Number(ms) || 0); },
|
|
18
|
+
getPause: () => pause.v, recovery: { maxAttempts: 1, mechanicalMaxAttempts: 3 },
|
|
19
|
+
runOne: async (n) => { calls.push(n); clock.t += 1000; onStart(n); const l = script[n] ?? [MERGED]; return l[Math.min(calls.filter((c) => c === n).length - 1, l.length - 1)]; },
|
|
20
|
+
decide: (d) => decisions.push(d), onUpdate: (r) => { updates.push(r); onRow(r); }, ...extra });
|
|
21
|
+
return p.then((rows) => ({ rows, calls, updates, decisions, byIssue: Object.fromEntries(rows.map((r) => [r.issue, r])) }));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
describe("#5975: batch pause", () => {
|
|
25
|
+
it("paused batch: a dependency merge does not dispatch the re-admitted dependent; after --unpause it does; the running lane completes", async () => {
|
|
26
|
+
const store = memStore(), pause = { v: null };
|
|
27
|
+
const a = await run({ script: {}, issues: [2, 1], store, pause, onStart: (n) => { if (n === 1) pause.v = REC; } });
|
|
28
|
+
assert.deepEqual(a.calls, [1], "the lane already running finishes through the pause; its dependent is not admitted");
|
|
29
|
+
assert.equal(a.byIssue[1].outcome, "merged");
|
|
30
|
+
assert.equal(a.byIssue[2].outcome, "held");
|
|
31
|
+
assert.match(a.byIssue[2].detail, /paused \(release cut, until unpause\)/);
|
|
32
|
+
assert.ok(a.updates.some((r) => r.outcome === "pause"), "a pause row");
|
|
33
|
+
pause.v = null; // --unpause, then --resume
|
|
34
|
+
const b = await run({ script: {}, issues: [2, 1], store, pause });
|
|
35
|
+
assert.deepEqual(b.calls, [2]);
|
|
36
|
+
assert.equal(b.byIssue[2].outcome, "merged");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("an engine upgrade re-admit of a held (engine/env) issue in a paused batch stays pending", async () => {
|
|
40
|
+
let v = "1.0.0"; const pause = { v: null };
|
|
41
|
+
const r = await run({ script: { 1: [EE("boom"), EE("boom"), MERGED] }, issues: [1], pause,
|
|
42
|
+
extra: { envHold: { maxMs: 120_000, watchMs: 30_000, version: () => v } },
|
|
43
|
+
onRow: (row) => { if (row.issue === 1 && row.outcome === "held") { v = "1.0.1"; pause.v = REC; } } });
|
|
44
|
+
assert.deepEqual(r.calls, [1, 1], "the upgrade would re-admit it, the pause keeps it pending");
|
|
45
|
+
assert.equal(r.byIssue[1].outcome, "held");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("a timed pause expires on its own (injected clock) and admission resumes", async () => {
|
|
49
|
+
const pause = { v: { ...REC, expiresAt: new Date(1_000_000 + 600_000).toISOString() } };
|
|
50
|
+
const clock = { t: 1_000_000 };
|
|
51
|
+
const r = await run({ script: {}, issues: [2, 1], pause, clock, extra: { expirePause: () => { const p = pause.v; if (p && Date.parse(p.expiresAt) <= clock.t) { pause.v = null; return { ...p, ownerGone: false }; } return null; } } });
|
|
52
|
+
assert.deepEqual(r.calls, [1, 2]);
|
|
53
|
+
assert.ok(r.updates.some((x) => x.outcome === "pause-expired"));
|
|
54
|
+
assert.ok(r.decisions.some((d) => /pause expired/.test(d.what)));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("without getPause (or with no pause set) admission is unchanged", async () => {
|
|
58
|
+
const r = await run({ script: {}, issues: [2, 1], extra: { getPause: null } });
|
|
59
|
+
assert.deepEqual(r.calls, [1, 2]);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe("#6008: hold and pause cover deferred retries and kept sandboxes", () => {
|
|
64
|
+
const CAP = { terminalReason: "deferred", code: "sandbox.capacity", retryInSeconds: 30, detail: "no sandbox capacity" };
|
|
65
|
+
it("a sandbox.capacity-deferred issue is not dispatched while held, including when its timer fires", async () => {
|
|
66
|
+
const held = { v: [] };
|
|
67
|
+
const r = await run({ script: { 1: [CAP, MERGED] }, issues: [1], extra: { getHeld: () => held.v }, onRow: (row) => { if (row.issue === 1 && row.outcome === "deferred") held.v = [1]; } });
|
|
68
|
+
assert.deepEqual(r.calls, [1], "the retry timer fired (clock advanced) but the held issue was not dispatched");
|
|
69
|
+
assert.notEqual(r.byIssue[1].outcome, "merged");
|
|
70
|
+
});
|
|
71
|
+
it("a sandbox.capacity-deferred issue is not dispatched while the batch is paused, including when its timer fires", async () => {
|
|
72
|
+
const pause = { v: null };
|
|
73
|
+
const r = await run({ script: { 1: [CAP, MERGED] }, issues: [1], pause, onRow: (row) => { if (row.issue === 1 && row.outcome === "deferred") pause.v = REC; } });
|
|
74
|
+
assert.deepEqual(r.calls, [1]);
|
|
75
|
+
assert.notEqual(r.byIssue[1].outcome, "merged");
|
|
76
|
+
});
|
|
77
|
+
it("a paused batch suspends its kept sandboxes; unpause lifts it", async () => {
|
|
78
|
+
const pause = { v: null }, marks = [];
|
|
79
|
+
const KEPT = { terminalReason: "deferred", code: "sandbox.unreachable", retryInSeconds: 60, detail: "kept for adopt", kept: { issue: 1, since: 1_000_000, phase: "implement" } };
|
|
80
|
+
await run({ script: { 1: [KEPT, MERGED] }, issues: [1], pause, extra: { suspendLane: (n, on, why) => marks.push([n, on, why]) },
|
|
81
|
+
onRow: (row) => { if (row.issue === 1 && row.outcome === "deferred") pause.v = REC; } });
|
|
82
|
+
assert.deepEqual(marks, [[1, true, "paused"]]);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
// #5978: standing orders: selector join/leave, re-admission policy, env.* join, breaker auto-reset, staging-lane close, coverage.
|
|
4
|
+
import { describe, it } from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { orchestrate } from "./orchestrate.mjs";
|
|
7
|
+
import { readmitDue, backoffMs, humanCode, environmentalDetail, closesManually, needsDecisionDigest, diffSelection, parseSelected, selectArgs, DEFER_CAP_MS, HELD_COOLDOWN_MS } from "./reconcile.mjs";
|
|
8
|
+
import { decideAutoReset } from "./clear-breaker.mjs";
|
|
9
|
+
import { coverage } from "./batch.mjs";
|
|
10
|
+
|
|
11
|
+
const harness = ({ script = {}, issues = [], reconcile, extra = {} }) => {
|
|
12
|
+
let t = 1_000_000;
|
|
13
|
+
const calls = [], decisions = [], updates = [];
|
|
14
|
+
return orchestrate({ issues, parallel: 2, readBody: async () => "", now: () => t, pollMs: 1000, reconcile, select: reconcile ? "no:milestone" : null,
|
|
15
|
+
sleep: async (ms) => { t += Math.max(1, Number(ms) || 0); },
|
|
16
|
+
runOne: async (n) => { calls.push(n); t += 1000; const l = script[n] ?? [{ terminalReason: "merged", pr: 1 }]; return l[Math.min(calls.filter((c) => c === n).length - 1, l.length - 1)]; },
|
|
17
|
+
decide: (d) => decisions.push(d), onUpdate: (r) => updates.push(r), ...extra }).then((rows) => ({ rows, calls, decisions, updates }));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const seeded = (results, more = {}) => ({ load: () => ({ v: 1, order: Object.keys(results).map(Number), pending: [], results, ...more }), save: () => {}, log: () => {} });
|
|
21
|
+
|
|
22
|
+
describe("selector reconcile (R2, R13)", () => {
|
|
23
|
+
it("a new matching issue joins within one interval, no operator command; a standing order ends only by stop", async () => {
|
|
24
|
+
let polls = 0;
|
|
25
|
+
const ac = new AbortController();
|
|
26
|
+
const list = async () => { polls++; if (polls >= 4) ac.abort(); return polls === 1 ? [{ number: 1 }] : [{ number: 1 }, { number: 2 }]; };
|
|
27
|
+
const r = await harness({ issues: [], reconcile: { everyMs: 5000, list }, extra: { signal: ac.signal } });
|
|
28
|
+
assert.deepEqual(r.calls.sort(), [1, 2]);
|
|
29
|
+
assert.ok(r.rows.every((x) => x.outcome === "merged"));
|
|
30
|
+
});
|
|
31
|
+
it("diffSelection joins matches and leaves closed pending issues, never running ones", () => {
|
|
32
|
+
const d = diffSelection({ open: [{ number: 5 }, { number: 6 }], members: [5, 7, 8], pending: [7], running: new Set([8]), results: new Map() });
|
|
33
|
+
assert.deepEqual(d, { join: [6], leave: [7] });
|
|
34
|
+
});
|
|
35
|
+
it("#6022 only a member the selector matched can leave: env.* issues, children, --add and argv members stay pending", () => {
|
|
36
|
+
const d = diffSelection({ open: [{ number: 5 }], members: [5, 7, 9], pending: [7, 9], running: new Set(), results: new Map(), matched: new Set([5, 7]) });
|
|
37
|
+
assert.deepEqual(d, { join: [], leave: [7] });
|
|
38
|
+
});
|
|
39
|
+
it("a failed read leaves nothing (parseSelected null)", () => {
|
|
40
|
+
assert.equal(parseSelected("not json"), null);
|
|
41
|
+
assert.deepEqual(parseSelected('[{"number":3,"labels":[{"name":"x"}]}]'), [{ number: 3, labels: ["x"] }]);
|
|
42
|
+
assert.ok(selectArgs("o/r", "no:milestone").includes("no:milestone"));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe("re-admission policy (R5, R6, R8, R14)", () => {
|
|
47
|
+
const rows = (o) => new Map([[9, { issue: 9, outcome: o }]]);
|
|
48
|
+
it("deferred retries with exponential backoff capped at 2h", () => {
|
|
49
|
+
const state = new Map();
|
|
50
|
+
assert.equal(readmitDue({ results: rows("deferred"), state, now: 0 }).requeue.length, 0);
|
|
51
|
+
assert.equal(readmitDue({ results: rows("deferred"), state, now: backoffMs(0) }).requeue.length, 1);
|
|
52
|
+
assert.equal(backoffMs(30), DEFER_CAP_MS);
|
|
53
|
+
assert.ok(backoffMs(2) > backoffMs(1));
|
|
54
|
+
});
|
|
55
|
+
it("held / engine-error re-admit on a version change, or after the 6h cooldown", () => {
|
|
56
|
+
for (const o of ["held", "engine-error"]) {
|
|
57
|
+
const state = new Map();
|
|
58
|
+
readmitDue({ results: rows(o), state, now: 0, version: "1" });
|
|
59
|
+
assert.equal(readmitDue({ results: rows(o), state, now: 1000, version: "1" }).requeue.length, 0);
|
|
60
|
+
assert.equal(readmitDue({ results: rows(o), state, now: 2000, version: "2" }).requeue.length, 1);
|
|
61
|
+
const s2 = new Map();
|
|
62
|
+
readmitDue({ results: rows(o), state: s2, now: 0, version: "1" });
|
|
63
|
+
assert.equal(readmitDue({ results: rows(o), state: s2, now: HELD_COOLDOWN_MS, version: "1" }).requeue.length, 1);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
it("a human-coded needs-human is never re-admitted", () => {
|
|
67
|
+
const r = new Map([[4, { issue: 4, outcome: "needs-human", detail: "needs credentials for the payment API" }]]);
|
|
68
|
+
assert.equal(readmitDue({ results: r, state: new Map(), now: 0 }).requeue.length, 0);
|
|
69
|
+
assert.ok(humanCode({ outcome: "needs-human", detail: "product decision needed" }));
|
|
70
|
+
assert.ok(!humanCode({ outcome: "needs-human", detail: "tests failed on lint" })); // negative example
|
|
71
|
+
assert.ok(!humanCode({ outcome: "engine-error", detail: "customers table" }));
|
|
72
|
+
});
|
|
73
|
+
it("conformance: one more attempt after the base moves, then parked in one digest", () => {
|
|
74
|
+
const row = new Map([[7, { issue: 7, outcome: "needs-human", conformance: { failed: true } }]]);
|
|
75
|
+
const state = new Map();
|
|
76
|
+
assert.equal(readmitDue({ results: row, state, now: 0, base: "a" }).requeue.length, 0);
|
|
77
|
+
assert.equal(readmitDue({ results: row, state, now: 1, base: "a" }).requeue.length, 0);
|
|
78
|
+
assert.equal(readmitDue({ results: row, state, now: 2, base: "b" }).requeue.length, 1);
|
|
79
|
+
const again = readmitDue({ results: row, state, now: 3, base: "c" });
|
|
80
|
+
assert.equal(again.requeue.length, 0);
|
|
81
|
+
assert.deepEqual(again.parked.map((p) => p.issue), [7]);
|
|
82
|
+
assert.match(needsDecisionDigest(again.parked), /needs decision \(1\): #7/);
|
|
83
|
+
assert.equal(needsDecisionDigest([]), "");
|
|
84
|
+
});
|
|
85
|
+
it("runner requeues an ended held issue on a version change without an operator command", async () => {
|
|
86
|
+
let ver = "1", polls = 0;
|
|
87
|
+
const ac = new AbortController();
|
|
88
|
+
const r = await harness({ issues: [1], reconcile: { everyMs: 1000, version: () => ver, list: async () => { if (++polls === 3) ver = "2"; if (polls > 8) ac.abort(); return [{ number: 1 }]; } },
|
|
89
|
+
extra: { signal: ac.signal, store: seeded({ 1: { issue: 1, outcome: "held", detail: "x" } }) } });
|
|
90
|
+
assert.deepEqual(r.calls, [1]);
|
|
91
|
+
assert.ok(r.updates.some((u) => u.issue === 1 && u.outcome === "requeued"));
|
|
92
|
+
assert.equal(r.rows[0].outcome, "merged");
|
|
93
|
+
});
|
|
94
|
+
it("the env.* issue the engine filed joins the order", async () => {
|
|
95
|
+
const ac = new AbortController(); let polls = 0;
|
|
96
|
+
const r = await harness({ issues: [], reconcile: { everyMs: 1000, list: async () => { if (++polls > 3) ac.abort(); return []; } },
|
|
97
|
+
extra: { signal: ac.signal, store: seeded({}, { envSigs: { "env.tool:x": { issues: [1, 2], number: 77 } } }) } });
|
|
98
|
+
assert.deepEqual(r.calls, [77]);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe("breaker auto-reset (R9)", () => {
|
|
103
|
+
it("environmental signature + cooldown + healthy pool resets; anything else does not", () => {
|
|
104
|
+
const tripped = { at: 100 };
|
|
105
|
+
const base = { tripped, now: 100 + 1000, cooldownMs: 500, environmental: true, poolHealthy: true };
|
|
106
|
+
assert.equal(decideAutoReset(base).reset, true);
|
|
107
|
+
assert.equal(decideAutoReset({ ...base, environmental: false }).reset, false);
|
|
108
|
+
assert.equal(decideAutoReset({ ...base, now: 200 }).reset, false);
|
|
109
|
+
assert.equal(decideAutoReset({ ...base, poolHealthy: false }).reset, false);
|
|
110
|
+
assert.equal(decideAutoReset({ ...base, tripped: null }).reset, false);
|
|
111
|
+
});
|
|
112
|
+
it("environmental details are recognised; product failures are not", () => {
|
|
113
|
+
assert.ok(environmentalDetail("sandbox.lost: VM restart"));
|
|
114
|
+
assert.ok(environmentalDetail("mirror fetch ETIMEDOUT"));
|
|
115
|
+
assert.ok(!environmentalDetail("assertion failed in foo.test.mjs"));
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe("staging lane close (R11)", () => {
|
|
120
|
+
it("only a merge into a non-default staging/milestone lane closes by hand", () => {
|
|
121
|
+
assert.ok(closesManually("staging"));
|
|
122
|
+
assert.ok(closesManually("milestone/v2"));
|
|
123
|
+
assert.ok(!closesManually("main"));
|
|
124
|
+
assert.ok(!closesManually(""));
|
|
125
|
+
});
|
|
126
|
+
it("the runner closes the issue after a merge into a staging lane", async () => {
|
|
127
|
+
const closed = [];
|
|
128
|
+
let polls = 0;
|
|
129
|
+
const ac = new AbortController();
|
|
130
|
+
await harness({ issues: [3], script: { 3: [{ terminalReason: "merged", pr: 1, lane: "staging" }] },
|
|
131
|
+
reconcile: { everyMs: 1000, list: async () => { if (++polls > 2) ac.abort(); return [{ number: 3 }]; }, closeIssue: async (n, o) => closed.push([n, o.lane]) },
|
|
132
|
+
extra: { signal: ac.signal } }).catch(() => null);
|
|
133
|
+
assert.deepEqual(closed, [[3, "staging"]]);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe("--status coverage (R12, R16)", () => {
|
|
138
|
+
it("0 unscheduled when each open match is running/queued/backing-off/waiting/human-blocked", () => {
|
|
139
|
+
const state = { pending: [2, 3, 4], running: { 1: {} }, notBefore: { 3: 9e15 }, deps: { 4: [2] }, results: { 5: { outcome: "needs-human", detail: "needs credentials" }, 6: { outcome: "deferred" } }, readmit: { 6: {} } };
|
|
140
|
+
const c = coverage({ state, open: [1, 2, 3, 4, 5, 6].map((number) => ({ number })), now: 1 });
|
|
141
|
+
assert.deepEqual([c.running, c.queued, c.backingOff, c.waitingDeps, c.humanBlocked, c.unscheduled], [[1], [2], [3, 6], [4], [5], []]);
|
|
142
|
+
});
|
|
143
|
+
it("a match nobody will run is unscheduled", () => {
|
|
144
|
+
const c = coverage({ state: { pending: [], results: { 8: { outcome: "needs-human", detail: "tests failed" } } }, open: [{ number: 8 }, { number: 9 }] });
|
|
145
|
+
assert.deepEqual(c.unscheduled, [8, 9]);
|
|
146
|
+
});
|
|
147
|
+
});
|