Verify native usage reporting across recovery and delivery boundaries

This commit is contained in:
2026-11-23 02:43:43 +00:00
parent 7aa4f2ec4d
commit 63beae814b
5 changed files with 107 additions and 27 deletions

View File

@@ -17,12 +17,15 @@ func TestNativeApplicationBuiltinsNeedNoConfiguration(t *testing.T) {
if err != nil {
t.Fatal(err)
}
for _, args := range [][]string{{"--help"}, {"help"}, {"version"}, {"completion", "bash"}, {"completion", "zsh"}, {"completion", "fish"}, {"config", "--help"}, {"pipeline", "--help"}, {"pipeline", "validate", "--help"}, {"pipeline", "run", "--help"}, {"run", "--help"}} {
for _, args := range [][]string{{"--help"}, {"help"}, {"version"}, {"completion", "bash"}, {"completion", "zsh"}, {"completion", "fish"}, {"config", "--help"}, {"pipeline", "--help"}, {"pipeline", "validate", "--help"}, {"pipeline", "run", "--help"}, {"run", "--help", "--show-tokens"}, {"config", "explain", "--show-tokens"}} {
var out, diagnostics bytes.Buffer
outcome := app.Execute(context.Background(), args, commandkit.Streams{Out: &out, Err: &diagnostics})
if outcome.Status != 0 || out.Len() == 0 {
t.Fatalf("%v: %#v, %s", args, outcome, diagnostics.String())
}
if strings.Contains(diagnostics.String(), "Observed PromptKit execution usage") {
t.Fatalf("help/builtin started usage reporting: %s", diagnostics.String())
}
if args[0] == "version" && !strings.Contains(out.String(), "v1.2.3") {
t.Fatalf("release identity missing: %s", out.String())
}