MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestSilentHandlerLoggingInTrace

Function TestSilentHandlerLoggingInTrace

rest/api_test.go:3329–3369  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3327}
3328
3329func TestSilentHandlerLoggingInTrace(t *testing.T) {
3330 // must have debug to assert that the endpoints below don't show in debug logs
3331 base.SetUpTestLogging(t, base.LevelDebug, base.KeyHTTP, base.KeyHTTPResp)
3332
3333 rt := NewRestTester(t, nil)
3334 defer rt.Close()
3335
3336 base.AssertLogNotContains(t, "_ping", func() {
3337 resp := rt.SendRequest(http.MethodGet, "/_ping", "")
3338 RequireStatus(t, resp, http.StatusOK)
3339 })
3340
3341 base.AssertLogNotContains(t, "/metrics", func() {
3342 headers := map[string]string{
3343 "Authorization": GetBasicAuthHeader(t, base.TestClusterUsername(), base.TestClusterPassword()),
3344 }
3345 resp := rt.SendMetricsRequestWithHeaders(http.MethodGet, "/metrics", "", headers)
3346 RequireStatus(t, resp, http.StatusOK)
3347 })
3348
3349 base.AssertLogNotContains(t, "/_metrics", func() {
3350 headers := map[string]string{
3351 "Authorization": GetBasicAuthHeader(t, base.TestClusterUsername(), base.TestClusterPassword()),
3352 }
3353 resp := rt.SendMetricsRequestWithHeaders(http.MethodGet, "/_metrics", "", headers)
3354 RequireStatus(t, resp, http.StatusOK)
3355 })
3356
3357 base.AssertLogNotContains(t, "/_expvar", func() {
3358 headers := map[string]string{
3359 "Authorization": GetBasicAuthHeader(t, base.TestClusterUsername(), base.TestClusterPassword()),
3360 }
3361 resp := rt.SendMetricsRequestWithHeaders(http.MethodGet, "/_expvar", "", headers)
3362 RequireStatus(t, resp, http.StatusOK)
3363 })
3364
3365 base.AssertLogNotContains(t, "/_expvar", func() {
3366 resp := rt.SendAdminRequest(http.MethodGet, "/_expvar", "")
3367 RequireStatus(t, resp, http.StatusOK)
3368 })
3369}
3370
3371// TestHLVUpdateOnRevReplicatorPut:
3372// - Test that the HLV is updated correctly when a document is put via the rev replicator running in rev mode

Callers

nothing calls this directly

Calls 11

CloseMethod · 0.95
SendRequestMethod · 0.95
SendAdminRequestMethod · 0.95
SetUpTestLoggingFunction · 0.92
AssertLogNotContainsFunction · 0.92
TestClusterUsernameFunction · 0.92
TestClusterPasswordFunction · 0.92
NewRestTesterFunction · 0.85
RequireStatusFunction · 0.85
GetBasicAuthHeaderFunction · 0.85

Tested by

no test coverage detected