kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
robert-stuttaford 2020-03-20T05:42:52.131900Z

so we have a bunch of tests which use logging. is there a resource i can read on dealing with log output during kaocha runs? we're using the documentation reporter

plexus 2020-03-20T08:58:23.133100Z

hi @robert-stuttaford, welcome to #kaocha! 🙂 what exactly are you looking for? I've set up a logging-related kaocha plugin for a client before, not sure if it's generalizable but I can see if I can share that or give you some pointers

robert-stuttaford 2020-03-20T09:08:40.134800Z

👋 😃 so we do logging via logback, and our code and tests are peppered with logging calls. I see that K handily rolls up logs collected when a test fails, for the fail report at the end. but it's also blatting them into the 'success tree' at the top, which i'd like to prevent, if possible. perhaps if i took a look at what you have, i'll get enough guidance to sort it out 🙂 thank you, sir!

robert-stuttaford 2020-03-20T09:13:42.135200Z

kaocha is a great piece of kit 👏

plexus 2020-03-20T15:27:18.136900Z

right, so kaocha by default captures output and only prints the output when a test fails. Since you are seeing them collected together in the failed test report I'm guessing you have output capturing enabled (i.e. you didn't explicitly disable it). then the question is, why are you still seeing it during the test run...

plexus 2020-03-20T15:29:39.138500Z

the way we do this is by installing our own (System/setOut new-stream) (System/setErr new-stream) and then restoring them afterwards, but if something holds a reference to the actual process stdout stream they can still print to that of course. Is it possible your logging is outputting to multiple places?

plexus 2020-03-20T15:31:19.139300Z

it surprises me that you are seeing the same logging output during the test run and in the failed test summary, normally it's either/or @robert-stuttaford

robert-stuttaford 2020-03-20T16:36:42.139700Z

ok that definitely gives me enough to dig around, thanks @plexus 🙂