MCPcopy Create free account
hub / github.com/zalando/skipper / TestAccessLogWithContext

Function TestAccessLogWithContext

logging/access_test.go:98–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96}
97
98func TestAccessLogWithContext(t *testing.T) {
99 entry := testAccessEntry()
100 traceID := "c4ddfe9d-a0d3-4afb-bf26-24b9588731a0"
101 entry.Request = entry.Request.WithContext(context.WithValue(entry.Request.Context(), accessLogContextKey{}, traceID))
102 expectedOutput := traceID
103
104 var buf bytes.Buffer
105 o := Options{
106 AccessLogOutput: &buf,
107 AccessLogFormatter: &accessCustomFormatter{},
108 }
109
110 testAccessLog(t, entry, expectedOutput, o)
111}
112
113func TestAccessLogFormatFull(t *testing.T) {
114 testAccessLogDefault(t, testAccessEntry(), logOutput)

Callers

nothing calls this directly

Calls 3

testAccessEntryFunction · 0.85
testAccessLogFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…