Commit 3d4e20f6 authored by Levin Zimmermann's avatar Levin Zimmermann

client_test: Keep NEO srv logs if test fails

If a test fails we may want to invest further why this test fails and
reading the NEO server log files can be an efficient way for these
investigations. Therefore we should keep log files if a test fails.
parent a1a9ff5b
...@@ -423,7 +423,13 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption ...@@ -423,7 +423,13 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
t.Helper() t.Helper()
X := xtesting.FatalIf(t) X := xtesting.FatalIf(t)
work, err := ioutil.TempDir("", "neo"); X(err) work, err := ioutil.TempDir("", "neo"); X(err)
defer os.RemoveAll(work) defer func() {
if t.Failed() {
t.Logf("NEO server log files reside in %s", work)
} else {
os.RemoveAll(work)
}
}()
f(work) f(work)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment