Make a seat pass no repair, read every machine before passing, keep the gate's pass in memory (issue 1317, review round 1)

This commit is contained in:
2026-10-19 21:38:41 +00:00
parent 12db1d3748
commit 3448f98000
7 changed files with 138 additions and 14 deletions
+8
View File
@@ -93,6 +93,13 @@ func TestAFailedPlanThatCannotBeRetriedHasNoActionAndSaysWhy(t *testing.T) {
})
superseded := aFailedPlan("plan-3", func(p *inventory.Plan) { p.State, p.Note = inventory.PlanSuperseded, "superseded by plan-9" })
done := aFailedPlan("plan-4", func(p *inventory.Plan) { p.State = inventory.PlanDone })
first := time.Date(2026, 10, 19, 18, 20, 0, 0, time.UTC)
gate := aFailedPlan("plan-5", func(p *inventory.Plan) {
p.Note = "openrazer stopped at its first machine"
p.Modules = map[string]*inventory.PlanModule{"openrazer": {State: "built", FirstAt: &first, First: []string{"g14"},
Why: "the build did not become healthy on g14", Gate: &inventory.PlanGate{Machines: []string{"g14"},
Verdict: inventory.GateFailed, Why: "not healthy", From: "aaaaaaa", To: "bbbbbbb"}}}
})
for name, c := range map[string]struct {
p inventory.Plan
others []inventory.Plan
@@ -101,6 +108,7 @@ func TestAFailedPlanThatCannotBeRetriedHasNoActionAndSaysWhy(t *testing.T) {
"a newer plan": {older, []inventory.Plan{newer}, "supersedes it"},
"superseded": {superseded, nil, "superseded"},
"done": {done, nil, "nothing to retry"},
"gate failed": {gate, nil, "failed its gate"},
} {
f := calm(now)
f.failed = []failedPlanFacts{failedFactsFor(c.p, c.others...)}