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:
C Cirello
2016-10-13 00:06:02 +02:00
committed by Seif Lotfy سيف لطفي
parent 5a1d9d4825
commit 4cbfb3ccfd
7 changed files with 137 additions and 12 deletions

View File

@@ -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)
}