23.03.2013 Views

Agile Performance Testing - Testing Experience

Agile Performance Testing - Testing Experience

Agile Performance Testing - Testing Experience

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In this article we describe how Hudson, a continuous integration<br />

server, helped us to achieve a next level of test automation, where<br />

we start tests on several machines from one central console.<br />

Test execution before using Hudson<br />

In our department we have a big collection of unit test cases. For<br />

each build that we test, we run these test cases on multiple environments:<br />

multiple application servers, multiple databases and<br />

multiple configurations. We have a set of Virtual Machines (VMs),<br />

all with their own specific configuration, and on each individual<br />

VM execute the same set of tests. Although we used ANT to automate<br />

our execution steps on a single machine, we still spent a lot<br />

of time connecting up all machines:<br />

• copying the new build to a central network location<br />

• on each machine: updating unit tests from the SVN repository<br />

• on each machine: starting ANT to install the new build, configuring<br />

the unit client environment, deploying software on<br />

the application server<br />

• on each machine: starting the application server, setting up<br />

the initial database, running tests, loading test results into<br />

the database<br />

• after execution has finished, generating a report with all test<br />

results.<br />

Most of these steps are the same for each VM, and need to be repeated<br />

for each new build. So getting this automated promised a<br />

lot of potential time saving.<br />

Introducing Hudson<br />

Next comes Hudson, a continuous integration tool written in<br />

Java, It supports SCM tools including CVS, Subversion, Git and<br />

Clearcase and can execute Apache Ant and Apache Maven based<br />

projects, as well as arbitrary shell scripts and Windows batch<br />

commands. Continuous integration servers are especially strong<br />

in distributing tasks over multiple machines. There is one central<br />

console that dispatches tasks to all nodes, and thus binds jobs<br />

together. In our company we also have experience with Teamcity<br />

and Bamboo, which are both licensed. We then came across<br />

Hudson, which is an open-source solution. The good thing about<br />

Hudson is that it has a very active community, and many additional<br />

plug-ins have been released, extending it from purely being<br />

a build tool for Java projects. New builds come out every week.<br />

We have set up Hudson on two different networks, and so far we<br />

© iStockphoto.com/petesaloutos<br />

Using Hudson to run junit regression tests<br />

on multiple machines<br />

by Manik Thakur & Jan Kester<br />

are very content. Below we will describe one of our set-ups, which<br />

runs in any servlet container.<br />

Installation<br />

On the Hudson website, http://Hudson-ci.org/, you can download<br />

the latest war, and either start this with Java -jar, or drop it in your<br />

favourite servlet container. When you run it from the command<br />

line, you can add some simple arguments to add basic security:<br />

java -jar Hudson.war –argumentsRealm.passwd.<br />

admin=donttell \<br />

--argumentsRealm.roles.admin=admin --http-<br />

Port=8001 --prefix=/Hudson<br />

Now you can open a browser at http://localhost:8001/Hudson/,<br />

and log in with admin/donttell.<br />

Image 1: Welcome Page of Hudson<br />

Alternatively, Hudson can be installed as a Windows service. Under<br />

Manage Hudson, there is a link which will configure Hudson<br />

as a Windows service under the installed directory provided.<br />

Configuration<br />

Under manage Hudson -> Configure System, we configured<br />

global settings and paths, which were commonly used by all the<br />

nodes (VMs). On the main page you can change settings for:<br />

• Smtp mail server: Of course, you will want this, as sending<br />

mail is essential for a continuous integration server.<br />

• Security settings: We only used simple security to have one<br />

single admin.<br />

• Default behavior for source code repositories.<br />

26 The Magazine for Professional Testers www.testingexperience.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!