Get help with testing, discuss unit testing strategies etc.


Post by chauncey-garrett »

Would it be possible to modify the JUnit test reporting to include the total number of test assertions that passed/failed?

We have some longer running tests that have >1000 assertions and if even one of them fails for some reason the entire test will be marked as 1 test failure. This makes it difficult to distinguish between a single assertion that failed and a catastrophic test failure where half of the assertions did not pass.

This also makes it difficult to report over time an increase in the amount of test coverage that our system has. I can add more assertions to a single test but not have any feedback if that test already existed.

Post by nickolay »

As I see every failed assertion is reported as a <failure> node inside the <testcase>. Do you mean adding some attributes for the <testcase>, like, indicating total # of assertions, total # of failed assertions etc?

Post by chauncey-garrett »

Yes, exactly!

We do get the failure node along with some amount of debugging information and that works great. The total number of assertions and number of failed assertions would definitely be useful information to have in addition.

Post by nickolay »

Ok, should be easy to add. Will do that tomorrow.

Post by nickolay »

Pushed to master, will be available in the next nightly.

Post by chauncey-garrett »

Thank you!

Post Reply