Question

I am trying to automate my build through Jenkins and facing some issues.

  1. I have some Unit test cases and some Sanity (Blockers) test in separate xml suites, and I want that if a Unit test fails the build should not be affected (should complete successfully) though I should got the failed case reports. But if any of the Sanity test case failed the build should be marked as failed.

  2. Also can I marked the build as failed if more than 70% Unit Test cases failed

Is this achievable thought some plugins or scripts, if so, Please let me know how?

I am using TestNG, Maven3 and Jenkins

No correct solution

OTHER TIPS

I think this question is similar to your first one: How to Run TestNG Tests on Jenkins. have a look and let me know.

Regarding the second one it is probably technically possible, but it is never a good idea.

When you write a test you are defining the expected behavior of your code: a failing test means you found a bug!

If the 70% threshold is due to unstable tests (aka tests failing randomly) than my only advice is: live with build unstability or rewrite them (the second is way way better). What happens if the threshold "hides" a real bug?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top