Unit Test error in @testSetup causes test runner to display incorrect results
If you use the @testSetup
annotation in your tests, and there is an error during it, the test runner displays Terminated when the tests finish. It doesn't give you a way to access the debug logs for that class to find out what went wrong.
Comments (5)
-
repo owner -
repo owner I've semi-reproduced this one. I can see that I don't get a log back for the tests that fail during TestSetup, but I'm not seeing the entire test run go to the Terminated state. All I'm doing to try to reproduce this is explicitly throwing an exception from the setup method. Can you provide an example of the type issue that occurred in your setup method? Also, can you see if there's anything useful in idea.log when this happens?
In the interim, I'll see if I can figure out whether a log is in fact available when this happens or not.
-
repo owner -
assigned issue to
- changed version to 1.2.1
-
assigned issue to
-
repo owner - changed status to resolved
-
repo owner - changed component to Apex Unit Testing
- Log in to comment
Interesting one. I have code coverage ready to go tonight. Once i have that out, I'll return to some of these unit test issues that have been opened and get them addressed.