diff --git a/command/status_test.go b/command/status_test.go index 4cdd96293..c4288bcaf 100644 --- a/command/status_test.go +++ b/command/status_test.go @@ -60,6 +60,35 @@ func TestStatusCommand_Run(t *testing.T) { if strings.Contains(out, "job1_sfx") || !strings.Contains(out, "job2_sfx") { t.Fatalf("expected only job2_sfx, got: %s", out) } + if !strings.Contains(out, "Allocations") { + t.Fatalf("should dump allocations") + } + ui.OutputWriter.Reset() + + // Query a single job showing evals + if code := cmd.Run([]string{"-address=" + url, "-evals", "job2_sfx"}); code != 0 { + t.Fatalf("expected exit 0, got: %d", code) + } + out = ui.OutputWriter.String() + if strings.Contains(out, "job1_sfx") || !strings.Contains(out, "job2_sfx") { + t.Fatalf("expected only job2_sfx, got: %s", out) + } + if !strings.Contains(out, "Evaluations") { + t.Fatalf("should dump evaluations") + } + if !strings.Contains(out, "Allocations") { + t.Fatalf("should dump allocations") + } + ui.OutputWriter.Reset() + + // Query a single job in verbose mode + if code := cmd.Run([]string{"-address=" + url, "-verbose", "job2_sfx"}); code != 0 { + t.Fatalf("expected exit 0, got: %d", code) + } + out = ui.OutputWriter.String() + if strings.Contains(out, "job1_sfx") || !strings.Contains(out, "job2_sfx") { + t.Fatalf("expected only job2_sfx, got: %s", out) + } if !strings.Contains(out, "Evaluations") { t.Fatalf("should dump evaluations") }