I've been making some improvements to our use of Hudson
recently that have been really helpful.
One
of this was using the matrix feature. The matrix feature is really
nice, that lets you configure jobs with multiple configurations,
running on multiple hosts etc. You can also set up your own
User-defined axis.
Here,
I would like to show how to set up matrix/multi-configuration jobs in
Hudson, that I used for my project.
I
was trying to set up my project for MySQL connector python.
The
challenge was to setup a job involving multiple variants as below
- multiple python versions,
- multiple server (MySQL) versions
and
so, I chose a matrix job, that finally looked like below -
Looking at console output, you would see - Triggering python2.6,mysql_56,oel Triggering python2.7,mysql_55,oel Triggering python3.3,mysql_56,oel Triggering python3.3,mysql_55,oel Triggering python2.6,mysql_55,oel Triggering python2.7,mysql_56,oel
Here is how you go about creating it.
Go to Hudson web
console (which would be something like <your Hudson server
name:port>)
Click 'New Job'
-> choose 'Build multi-configuration project' (seen below)
which opens up a
configure job window for you, where you choose your Source Code
Management (I chose 'Bazaar' repository for my job). You can also
choose the 'Build Trigger' as 'Poll SCM' or 'Build periodically' etc.
Now the main important
configuration here is 'Configuration Matrix' (seen below)
Choose 'User-defined'
Axis, Add name/value pairs for python versions, server versions
(seen below)
Also add the 'Slaves'
Axis for choosing the slaves (test boxes/VMs) you want to run
your tests on. You can configure more than 1 boxes with different
OS/platforms, though to not overly complicate the matrix, I chose 1
box here and decided to replicate the job for different OS
separately.
You might also want to
choose the option 'Tie parent build to a node' (seen
below)
Choose your 'Build
step' (I have chosen 'Execute shell') , add the code and save the
job.
Job done :).The
generated matrix and result page looks as below -