jenkins the definitive guide

(Jeff_L) #1

probably take a large proportion of the time. So this graph is a great way to see how well your tests
are performing as well.


Figure 6.8. Build time trends can give you a good indicator of how fast your tests are running


When you are on the Test Results page (see Figure 6.6, “Jenkins displays a summary of the test results”),
you can also drill down and see how long the tests in a particular module, package or class are taking
to run. Just click on the test duration in the test results page (“Took 31 ms” in Figure 6.6, “Jenkins
displays a summary of the test results”) to view the test history for a package, class, or individual test
(see Figure 6.9, “Jenkins also lets you see how long your tests take to run”). This makes it easy to isolate
a test that is taking more time than it should, or even decide when a general optimization of your unit
tests is required.


6.5. Ignoring Tests


Jenkins distinguishes between test failures and skipped tests. Skipped tests are ones that have been
deactivated, for example by using the @Ignore annotation in JUnit 4:


@Ignore("Pending more details from the BA")
@Test
public void cashWithdrawalShouldDeductSumFromBalance() throws Exception {
Account account = new Account();
account.makeDeposit(100);
account.makeCashWithdraw(60);
assertThat(account.getBalance(), is(40));
}
Free download pdf