mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Reduce test log verbosity (#150)
* Reduce test verbosity * Divert gin's log to the test buffer * Divert stdlib's log to the test buffer * Add bolt tests into log buffer * Add a linebreak to improve log output layout
This commit is contained in:
committed by
Seif Lotfy سيف لطفي
parent
5a1d9d4825
commit
4cbfb3ccfd
@@ -86,6 +86,7 @@ func prepareBolt(t *testing.T) (models.Datastore, func()) {
|
||||
}
|
||||
|
||||
func TestFullStack(t *testing.T) {
|
||||
buf := setLogBuffer()
|
||||
ds, close := prepareBolt(t)
|
||||
defer close()
|
||||
|
||||
@@ -116,6 +117,7 @@ func TestFullStack(t *testing.T) {
|
||||
_, rec := routerRequest(t, router, test.method, test.path, bytes.NewBuffer([]byte(test.body)))
|
||||
|
||||
if rec.Code != test.expectedCode {
|
||||
t.Log(buf.String())
|
||||
t.Errorf("Test %d: Expected status code to be %d but was %d",
|
||||
i, test.expectedCode, rec.Code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user