Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Test log lines get cleared after failure
rdavis
#1 Posted : Tuesday, July 12, 2022 12:36:37 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/26/2015(UTC)
Posts: 8
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
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
#2 Posted : Tuesday, July 12, 2022 12:55:59 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,614

Thanks: 869 times
Was thanked: 1183 time(s) in 1103 post(s)
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?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.024 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download