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.
36 lines
925 B
Go
36 lines
925 B
Go
package cli
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"encoding/json"
|
|
"strings"
|
|
"testing"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/buildinfo"
|
|
)
|
|
|
|
func TestVersionIsOffline(t *testing.T) {
|
|
t.Setenv("PIPELINES_URL", "not-a-websocket-url")
|
|
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
|
for _, args := range [][]string{{"version", "--json"}, {"--version", "--json"}, {"version"}} {
|
|
var out bytes.Buffer
|
|
app := App{Out: &out, Err: &out, In: strings.NewReader("")}
|
|
if err := app.Run(context.Background(), args); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
want := buildinfo.Current()
|
|
if args[len(args)-1] == "--json" {
|
|
var got buildinfo.Info
|
|
if err := json.Unmarshal(out.Bytes(), &got); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got.Version != want.Version || got.Commit != want.Commit {
|
|
t.Fatal("wrong CLI identity", got)
|
|
}
|
|
} else if !strings.Contains(out.String(), "pipelines "+want.Version) {
|
|
t.Fatal(out.String())
|
|
}
|
|
}
|
|
}
|