micro--go-micro
665da6c6d2
Run Tests / Unit Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
34 行
858 B
Go
34 行
858 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
microcmd "go-micro.dev/v6/cmd"
|
|
)
|
|
|
|
func TestZeroToHeroCLIBoundaries(t *testing.T) {
|
|
commands := map[string]bool{}
|
|
subcommands := map[string]map[string]bool{}
|
|
for _, command := range microcmd.DefaultCmd.App().Commands {
|
|
commands[command.Name] = true
|
|
for _, subcommand := range command.Subcommands {
|
|
if subcommands[command.Name] == nil {
|
|
subcommands[command.Name] = map[string]bool{}
|
|
}
|
|
subcommands[command.Name][subcommand.Name] = true
|
|
}
|
|
}
|
|
|
|
for _, want := range []string{"run", "chat", "flow", "inspect"} {
|
|
if !commands[want] {
|
|
t.Fatalf("missing %q command", want)
|
|
}
|
|
}
|
|
if !subcommands["flow"]["runs"] {
|
|
t.Fatal("missing inspect boundary: flow runs")
|
|
}
|
|
if !subcommands["inspect"]["agent"] || !subcommands["inspect"]["flow"] {
|
|
t.Fatal("missing inspect boundary: inspect agent/flow")
|
|
}
|
|
}
|