Verify native usage reporting across recovery and delivery boundaries
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user