Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bookkeeping package tests #465

Closed
joe94 opened this issue Apr 6, 2020 · 0 comments · Fixed by #708
Closed

Fix bookkeeping package tests #465

joe94 opened this issue Apr 6, 2020 · 0 comments · Fixed by #708
Assignees
Labels

Comments

@joe94
Copy link
Member

joe94 commented Apr 6, 2020

The bookkeeping package tests fail intermittently. Since the package is not being used anywhere, the tests were ignored until this issue is resolved.

=== RUN   TestReturnHeadersWithPrefix/9
    TestReturnHeadersWithPrefix/9: requestResponse_test.go:189: struct { request *http.Request; prefixs []string; expectedKV []interface {} }{request:(*http.Request)(0xc0000cb400), prefixs:[]string{"X-TEST-3", "x-TEsT-1", "x-TesT-2"}, expectedKV:[]interface {}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}}
=== RUN   TestReturnHeadersWithPrefix/10
    TestReturnHeadersWithPrefix/10: requestResponse_test.go:189: struct { request *http.Request; prefixs []string; expectedKV []interface {} }{request:(*http.Request)(0xc0000cb500), prefixs:[]string{"X-TEST"}, expectedKV:[]interface {}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}}
    TestReturnHeadersWithPrefix/10: requestResponse_test.go:120: 
        Expecting: (map[string]interface {}) (len=1) {
         (string) (len=4) "test": ([]string) (len=2 cap=2) {
          (string) (len=3) "foo",
          (string) (len=3) "bar"
         }
        }
        
         but got: (map[string]interface {}) (len=1) {
         (string) (len=4) "test": ([]string) (len=1 cap=1) {
          (string) (len=3) "foo"
         }
        }
        
--- FAIL: TestReturnHeadersWithPrefix (0.01s)
    --- PASS: TestReturnHeadersWithPrefix/0 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/1 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/2 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/3 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/4 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/5 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/6 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/7 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/8 (0.00s)
    --- PASS: TestReturnHeadersWithPrefix/9 (0.00s)
    --- FAIL: TestReturnHeadersWithPrefix/10 (0.00s)
=== RUN   TestRequestBody
=== RUN   TestRequestBody/0
    TestRequestBody/0: requestResponse_test.go:215: struct { request *http.Request; expected []interface {} }{request:(*http.Request)(0xc00019ea00), expected:[]interface {}{"req-body", "empty body"}}
=== RUN   TestRequestBody/1
    TestRequestBody/1: requestResponse_test.go:215: struct { request *http.Request; expected []interface {} }{request:(*http.Request)(0xc00019eb00), expected:[]interface {}{"req-body", "payload"}}
--- PASS: TestRequestBody (0.00s)
    --- PASS: TestRequestBody/0 (0.00s)
    --- PASS: TestRequestBody/1 (0.00s)
=== RUN   TestResponseBody
=== RUN   TestResponseBody/0
    TestResponseBody/0: requestResponse_test.go:241: struct { response bookkeeping.CapturedResponse; expected []interface {} }{response:bookkeeping.CapturedResponse{Code:0, Payload:[]uint8(nil), Header:http.Header(nil)}, expected:[]interface {}{"res-body", "empty body"}}
=== RUN   TestResponseBody/1
    TestResponseBody/1: requestResponse_test.go:241: struct { response bookkeeping.CapturedResponse; expected []interface {} }{response:bookkeeping.CapturedResponse{Code:0, Payload:[]uint8{0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64}, Header:http.Header(nil)}, expected:[]interface {}{"res-body", "payload"}}
--- PASS: TestResponseBody (0.00s)
    --- PASS: TestResponseBody/0 (0.00s)
    --- PASS: TestResponseBody/1 (0.00s)
FAIL
coverage: 83.8% of statements
FAIL	github.com/xmidt-org/webpa-common/bookkeeping	0.036s

Source: https://travis-ci.org/github/xmidt-org/webpa-common/jobs/670759741?utm_medium=notification&utm_source=github_status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment