jenkins the definitive guide

(Jeff_L) #1

Figure 5.31. Running Groovy scripts as part of a build job


5.6.6. Building Projects in Other Languages


Jenkins is a flexible tool, and it can be used for much more than just Java and Groovy. For example,
Jenkins also works well with Grails, .Net, Ruby, Python and PHP, just to name a few. When using other
languages, you generally need to install a plugin to support your favorite language, which will add a
new build step type for this language. We will look at some examples in Section 5.10, “Using Jenkins
with Other Languages”.


5.7. Post-Build Actions


Once the build is completed, there are still a few things you need to look after. You might want to archive
some of the generated artifacts, to report on test results, and to notify people about the results. In this
section, we look at some of the more common tasks you need to configure after the build is done.


5.7.1. Reporting on Test Results


One of the most obvious requirements of a build job is to report on test results. Not only whether there
are any test failures, but also how many tests were executed, how long they took to execute, and so on.
In the Java world, JUnit is the most commonly-used testing library around, and the JUnit XML format
for test results is widely used and understood by other tools as well.


Jenkins provides great support for test reporting. In a freestyle build job, you need to tick the “Publish
JUnit test result report” option, and provide a path to your JUnit report files (see Figure 5.32, “Reporting
on test results”). You can use a wildcard expression (such as */target/surefire-reports/.xml
in a Maven project) to include JUnit reports from a number of different directories—Jenkins will
aggregate the results into a single report.

Free download pdf