05ae530442
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package tui
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"path/filepath"
|
|
"slices"
|
|
"testing"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/protocol"
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
func TestRunDebugActionAvailableForRunningAndFinishedRuns(t *testing.T) {
|
|
bin := t.TempDir()
|
|
os.WriteFile(filepath.Join(bin, "pipelines"), []byte("#!/bin/sh\nexit 0\n"), 0700)
|
|
t.Setenv("PATH", bin+string(os.PathListSeparator)+os.Getenv("PATH"))
|
|
for _, status := range []string{"running", "failed", "succeeded", "canceled"} {
|
|
m := New(context.Background(), "ws://example/connect")
|
|
m.runOpen = true
|
|
m.keys.runs = true
|
|
m.requestedRunID = 7
|
|
m.runDetail = &protocol.RunDetail{RunSummary: protocol.RunSummary{ID: 7, Status: status}}
|
|
if !slices.Contains(m.pageCommands(), ":debug") {
|
|
t.Fatal("debug unavailable", status)
|
|
}
|
|
updated, cmd := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'D'}})
|
|
m = updated.(Model)
|
|
if cmd == nil || !m.editorOpen || m.editorDebugRunID != 7 || m.runDetail.ID != 7 || m.runStartRequest != "" || m.runDetail.Status != status {
|
|
t.Fatal("debug changed or retried run", status)
|
|
}
|
|
}
|
|
}
|