Reputation: 352
I'm new with Jenkins and I have a problem with builds. I'm writing UI tests with Selenium, Java and TestNG.
My problem is that Jenkins always shows Finished: SUCCESS
even if some tests fail.
===============================================
TestAll
Total tests run: 10, Failures: 1, Skips: 0
===============================================
[SSH] exit-status: 0
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Did not find any matching files.
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Notifying upstream projects of job completion
No emails were triggered.
Finished: SUCCESS
How can I resolve my problem?
Upvotes: 0
Views: 253
Reputation: 499
I assume you are building a Maven Project. To stop a build on test failure, go to the configure part of your project then go to the build section and in "goals & options line" add :
-Dmaven.test.failure.ignore=false
this should stop the build if errors are found.
Upvotes: 2