Reputation: 154
I use Maven+TestNG auto-tests run by Jenkins. I know that the is a token for failed tests like ${FAILED_TESTS} but it also includes long stack-trace which is difficult to read.
So I want Jenkins to send email like this: Run: 10, Failed:2, Passed: 8
Upvotes: 1
Views: 7746
Reputation: 45
Total:${TEST_COUNTS, var="total"}
Success:${TEST_COUNTS, var="pass"}
Fail:${TEST_COUNTS, var="fail"}
Upvotes: 1
Reputation: 7163
Try -
Run: ${TEST_COUNTS}, Failed: ${TEST_COUNTS,var="fail"}, Passed: {$TEST_COUNTS,var="pass"}
You can also print out the skipped tests -
Skipped: ${TEST_COUNTS,var="skip"}
Take a look at the source code for TestCountsContent.java
Or are you saying this doesn't work with TestNG?
Upvotes: 1
Reputation: 6463
It looks like you could customize the email template by using the Email-ext plugin and Jelly templates.
See http://softwaretestautomationnotes.blogspot.com/2011/07/customizing-post-build-email.html for an example of this.
I don't know of any way to do this out of the box.
Upvotes: 2