From 3eba72cbffc3c168bac14c11cda47d4a519b11d9 Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 2 May 2021 12:52:29 -0500 Subject: [PATCH] extend health chek to make sure all pings called --- app/proxy/health_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/proxy/health_test.go b/app/proxy/health_test.go index d219c8c..187676c 100644 --- a/app/proxy/health_test.go +++ b/app/proxy/health_test.go @@ -72,7 +72,9 @@ func TestHttp_healthHandler(t *testing.T) { fmt.Fprintf(w, "response %s", r.URL.String()) })) + var count int ps := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + count++ t.Logf("req: %v", r) if r.URL.Path == "/123/ping" { return @@ -118,6 +120,7 @@ func TestHttp_healthHandler(t *testing.T) { assert.Equal(t, 2., res["failed"]) assert.Equal(t, 2, len(res["errors"].([]interface{}))) assert.Contains(t, res["errors"].([]interface{})[0], "400 Bad Request") + assert.Equal(t, 3, count, "3 pings for non-assets routes") } func TestHttp_pingHandler(t *testing.T) {