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.
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). You can use a wildcard
expression (such as
in a Maven project) to include JUnit reports from a number of different
directories—Jenkins will aggregate the results into a single
Figure 5-32. Reporting on test results
We look at automated tests in much more detail in Chapter 6.
With a few exceptions, the principal goal of a build job is generally to build something. In Jenkins, we call this something ...