(t *testing.T)
| 1444 | } |
| 1445 | |
| 1446 | func TestPProfServer(t *testing.T) { |
| 1447 | c := NewCommand(WithDialer(&spyDialer{})) |
| 1448 | c.SilenceUsage = true |
| 1449 | c.SilenceErrors = true |
| 1450 | c.SetArgs([]string{"--debug", "--admin-port", "9191", "my-project:my-region:my-instance"}) |
| 1451 | ctx, cancel := context.WithCancel(context.Background()) |
| 1452 | defer cancel() |
| 1453 | |
| 1454 | go c.ExecuteContext(ctx) |
| 1455 | resp, err := tryDial("GET", "http://localhost:9191/debug/pprof/") |
| 1456 | if err != nil { |
| 1457 | t.Fatalf("failed to dial endpoint: %v", err) |
| 1458 | } |
| 1459 | if resp.StatusCode != http.StatusOK { |
| 1460 | t.Fatalf("expected a 200 status, got = %v", resp.StatusCode) |
| 1461 | } |
| 1462 | } |
| 1463 | |
| 1464 | func TestQuitQuitQuitHTTPPost(t *testing.T) { |
| 1465 | c := NewCommand(WithDialer(&spyDialer{})) |
nothing calls this directly
no test coverage detected