Investigate missing captured errors in Go1.14.x and 1.15.x
mfridman opened this issue · 1 comments
mfridman commented
The "summarized" error fails to return the debug lines. It points at the test name, but omits the failure in this contrived example.
=== RUN TestErrorCause
=== PAUSE TestErrorCause
=== CONT TestErrorCause
TestErrorCause: lg_test.go:248: failed to get err type:
got : "*json.SyntaxError: invalid character ':' after top-level value"
want: "*json.SyntaxError: invalid character ':' after top-level valu"
--- FAIL: TestErrorCause (0.00s)
FAIL
coverage: 24.7% of statements
FAIL github.com/some/pkg/lg 0.115s
FAIL: github.com/some/pkg/lg
-------------------------------
--- FAIL: TestErrorCause (0.00s)
Here is the raw json dump
{"Time":"2020-07-04T11:22:46.223994-04:00","Action":"run","Package":"github.com/some/pkg/lg","Test":"TestErrorCause"}
{"Time":"2020-07-04T11:22:46.224254-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":"=== RUN TestErrorCause\n"}
{"Time":"2020-07-04T11:22:46.224277-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":"=== PAUSE TestErrorCause\n"}
{"Time":"2020-07-04T11:22:46.224281-04:00","Action":"pause","Package":"github.com/some/pkg/lg","Test":"TestErrorCause"}
{"Time":"2020-07-04T11:22:46.224284-04:00","Action":"cont","Package":"github.com/some/pkg/lg","Test":"TestErrorCause"}
{"Time":"2020-07-04T11:22:46.224287-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":"=== CONT TestErrorCause\n"}
{"Time":"2020-07-04T11:22:46.224292-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":" TestErrorCause: lg_test.go:248: failed to get err type:\n"}
{"Time":"2020-07-04T11:22:46.22432-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":" got : \"*json.SyntaxError: invalid character ':' after top-level value\"\n"}
{"Time":"2020-07-04T11:22:46.224338-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":" want: \"*json.SyntaxError: invalid character ':' after top-level valu\"\n"}
{"Time":"2020-07-04T11:22:46.224352-04:00","Action":"output","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Output":"--- FAIL: TestErrorCause (0.00s)\n"}
{"Time":"2020-07-04T11:22:46.224358-04:00","Action":"fail","Package":"github.com/some/pkg/lg","Test":"TestErrorCause","Elapsed":0}
{"Time":"2020-07-04T11:22:46.22437-04:00","Action":"output","Package":"github.com/some/pkg/lg","Output":"FAIL\n"}
{"Time":"2020-07-04T11:22:46.224374-04:00","Action":"output","Package":"github.com/some/pkg/lg","Output":"coverage: 24.7% of statements\n"}
{"Time":"2020-07-04T11:22:46.22462-04:00","Action":"output","Package":"github.com/some/pkg/lg","Output":"FAIL\tgithub.com/some/pkg/lg\t0.261s\n"}
{"Time":"2020-07-04T11:22:46.224637-04:00","Action":"fail","Package":"github.com/some/pkg/lg","Elapsed":0.261}
In this example I want all the Output
lines to be printed out
mfridman commented
I tried this with go1.13.2
and it worked. So this must be a regression with 1.14.x
.. need to investigate the following 2 commits: