I have an intermittently-failing test, so I'm trying to use the Churn functionality to track down why it sometimes fails. I've temporarily added some debug (Console.WriteLine) lines to the classes under test for some diagnostic output. When the test passes, these lines are visible in the Trace Output section of the "NCrunch Tests" window. However, when the test fails (the scenario in which I need this diagnostic information), I can no longer see these lines. The only data in the Trace Output when the test fails is the stack trace of the assertion failure.
Is the Trace Output getting cleared upon test failure? Is it possible to view diagnostic logging lines when a test has failed? If I need to write these out via a different method, that would be fine, but I'd rather not have to do something like reference NUnit or NCrunch libraries from my system-under-test.
Thanks!
Remco NCrunch Developer
#16211
12 Jul 2022 12:55 UTC
Hi, thanks for sharing this problem.
NCrunch redirects and captures everything written to the Console stream. This will be shown in the output in the Tests Window regardless of whether the test has passed or failed. At least, it's supposed to.
Can you check the coverage markers of the failing test to ascertain whether the debug lines are being executed?
NCrunch redirects and captures everything written to the Console stream. This will be shown in the output in the Tests Window regardless of whether the test has passed or failed. At least, it's supposed to.
Can you check the coverage markers of the failing test to ascertain whether the debug lines are being executed?
Post a reply
Log in to reply.