2

I need to automate Unit testing on Jenkins for non-Java project.

I've created a job which pulls code from TFS and successfully generating the builds at a given intervals.

Now, how do I tell Jenkins to generate the Unit test cases?

Do I need to write any scripts like ANT.

Can anyone please guide me on the steps I need to follow?

Rje
  • 21
  • 1
  • 2
  • Jenkins isn't a tool for *writing* unit test cases. Jenkins can certainly *run* test cases, but it can't magically create them. – Christopher Orr Jan 27 '13 at 14:12

1 Answers1

2

I'm assuming that you are happy with the "trigger" process so I won't consider that

The rest of it

1) in the Build section add a step that will run the unit tests and output in a form that one of the post build actions will understand. For example in python

python setup.py nosetests --with-xunit

2) Add a post build action to publish the results. For example with the command above add a "publish junit result report" as a post-build action and configure the "Test report XMLs" as "**/nosetests.xml"

There are plenty of ways of doing this but the basic two steps are make the unit tests run and generate some output that one of the report generators understands. Then configure the report generator

Vorsprung
  • 32,923
  • 5
  • 39
  • 63
  • Hi, thanks for your reply :) My requirement is to generate the test cases for Message Broker Code (WMB). How do I configure the test cases that my code has to verify? If it was for Phython/PHP there are seperate plugins. If the plugin is not available then what are the steps that I need to follow? – Rje Jan 21 '13 at 10:50
  • For unsupported things like your WMB is all you have to do is make it run tests that output in the format that junit or xunit plugins expect. It's just some xml files. The file format is discussed in this answer: http://stackoverflow.com/questions/4922867/junit-xml-format-specification-that-hudson-supports – Vorsprung Jan 21 '13 at 17:43