Jenkins execute shell build error while running testng.xml file

Below is the error i am encountering while running a testng.xml file. My Jenkins is hosted on an EC2 Linux instance. (1)
Also i am sharing the commands that i’m running in execute shell below (2).
I have installed TestNG and Selenium plugin and the reports show that the test have passed. i am sharing that screen shot as well (3).
Please help on how to configure Jenkins so that the build is a success.
Thank you

(1) /var/lib/jenkins/workspace/selenium_002/TestSoft/testng.xml
[main] INFO org.testng.internal.Utils - [TestNG] Running:
/var/lib/jenkins/workspace/selenium_002/TestSoft/testng.xml

===============================================
Suite
Total tests run: 0, Passes: 0, Failures: 0, Skips: 0

Build step ‘Execute shell’ marked build as failure
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Saving reports…
Processing ‘/var/lib/jenkins/jobs/selenium_002/builds/29/testng/testng-results-1.xml’
Processing ‘/var/lib/jenkins/jobs/selenium_002/builds/29/testng/testng-results.xml’
TestNG Reports Processing: FINISH

(2)export projectLocation="/var/lib/jenkins/workspace/selenium_002/TestSoft"
export classpath="/var/lib/jenkins/workspace/selenium_002/TestSoft/bin/;/var/lib/jenkins/workspace/selenium_002/TestSoft/lib/"
chmod a+x /var/lib/jenkins/workspace/selenium_002/TestSoft/lib/
.jar
java -cp “/var/lib/jenkins/workspace/selenium_002/TestSoft:/var/lib/jenkins/workspace/selenium_002/TestSoft/lib/*” org.testng.TestNG /var/lib/jenkins/workspace/selenium_002/TestSoft/testng.xml

(3)

I believe that the JUnit and TestNG plugins both consider it a failure if a test results file is found and that test results file reports that no tests were run. Are you applying some form of optimization that skips tests?

No, i haven’t applied any optimization to skip the tests. I have run the same file in Eclipse IDE and the windows cmd with a different set of batch commands, it ran successfully there. Even in Jenkins the TestNG reports show that my testAdd method is run successfully but the build is marking it as a failure.
Below i am sharing a screen shot of the TestNG results overview. I have only 1 test method called testAdd.

Since the job is reporting a failure, I believe that means one or more of the programs that was called by Jenkins returned a non-zero exit code. You’ll need to find the program that is returning a non-zero exit code and identify whether than non-zero exit code has the correct meaning.

Some tools return a non-zero exit code for conditions that are not errors. If that is the case here, then you’ll need to “fake it” with an “exit 0” at the end of the script. However, you should consider that only as a last resort after you have found the cause of the non-zero exit code and confirmed that you cannot adapt it so that it returns 0 on success.

okay, thank you sir for your time. I will get back to you if i face more issues.