runner: keep export handoffs nonterminal through recovery
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.a-wan.net/alan/pipelines/internal/protocol"
|
||||
)
|
||||
|
||||
func TestExportWaitRendersRecoveryNotHumanDecision(t *testing.T) {
|
||||
run := &protocol.RunDetail{RunSummary: protocol.RunSummary{ID: 7, Status: "waiting", ExportPendingSequence: 2, CurrentStage: "worker"}, Graph: protocol.Graph{Stages: []protocol.Stage{{Key: "worker", Type: "model", Edges: map[string]string{"success": "next", "error": "#failure"}}}}}
|
||||
frame := strings.Join(waitingLines(run), "\n")
|
||||
if !strings.Contains(frame, "Waiting for session export") || strings.Contains(frame, "person") || strings.Contains(frame, "Decide:") {
|
||||
t.Fatalf("export wait offered a human choice:\n%s", frame)
|
||||
}
|
||||
m := Model{runDetail: run}
|
||||
_, options, _ := m.waitingStage()
|
||||
if len(options) != 0 {
|
||||
t.Fatal("model-stage edges exposed as human options")
|
||||
}
|
||||
updated, _ := m.openDecision()
|
||||
if updated.(Model).decisionOpen {
|
||||
t.Fatal("opened decision for export wait")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user