We have a JUnit test suite that we usually run from Eclipse. We have recently started a process of trying to get a better development environment. As part of this we have started building our project in Jenkins. We would also like it if it was possible to run theJUnit test suite during our build. To do this I think we need a way to execute the test suite from command line so that we can integrate them in Jenkins and parse their output.
How can we set up Jenkins to run our tests?
You could create a
junitant task during your build and let Jenkins run that taskHere are some lines we used on a project. Here launching a suite called
AllNonGWTTestCaseTestsBuilding this will create the file result.xml. That configures an ant task.
Jenkins can launch this ant task. Take a look at your project configuration. Section
Build > Ant task. Then inPost-build Actionsjust set the path to the xml file : result.xmlThis should make Jenkins run the test suite as a post build action.