0

I have python unittest tests using Selenium 2 and I can run it fine on my computer but now I want to use it with Jenkins. In the "execute shell", I call my script that runs all my Selenium tests but even though I get an Error or Fail for the tests, Jenkins says "Finished: SUCCESS" in the console output and thinks it passed in the console output.

1) Why does it think it passed? How can I let Jenkins detect it actually failed?

2) How can I generate an XML report of the test results so that it is compatible with JUnit and Jenkins? (testrunner?)

Thanks!

3
  • Can you show the command your running in Jenkins? Commented Aug 3, 2012 at 14:15
  • @lazy1 It's just python2.7 start-tests.py. Inside that I have suite definitions, then if __name__=='__main__', ......then unittest.TextTestRunner().run(suite()). Commented Aug 3, 2012 at 14:18
  • Hard to tell. My guess will be that failure in the test does not result in non-zero value returned from the script. Maybe another command after the python start-tests.py that does not fail? Commented Aug 4, 2012 at 14:19

1 Answer 1

2

For 2 you can use nosetests --with-xunit.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.