CST316 Software Enterprise II: Construction and TransitionSpring 2011
Lab 5, Continuous Build and TestMarch23, 2011
Objective: Understand how to create continuous build jobs using Hudson.
Activity: Register on Hudson
We have installed a Hudson continuous build server at Access this URL and select “sign-up”. For username, use the same id that matches Trac (which should be your ASURITE id). You may set any password you wish. Please use a valid email address.
Activity: Modify your local Ant installation
You need to modify your local Ant installation to be able to run ant tasks for findbugs. Download the findbugs zip from the class website, and the findbugs ant extension jar. You will need to install findbugs-1.3.9 in $HOME/tools/findbugs-1.3.9, and copy the ant extension jar to $ANT_HOME/lib.
Activity: Setup your local SVN project
You should be paired with the same person you did Lab 1 with, and use the same group number as you used for that lab (if you recall, we had group1 through group12). Do the following:
-ensure you have a valid source tree from svn on lead2 (svn://lead2.poly.asu.edu/groupX). You probably should just go to a clean directory and check out the tree again, though you are free to go to an existing directory and do an “svn up” if that works as well.
-Go to a clean directory and do “svn export svn://lead2.poly.asu.edu/group0”. This should look like a checkout, except the export command does not create those “.svn” hidden entries in your directories, because you are basically saying you want a copy of the source tree from svn but you do not intend to change and commit back.
-COPY the lab1/src/edu/asupoly/cst316/examples directory over to your groupX source tree. Likewise, copy the top-level build.xml from group0 over to your groupX top-level directory. To ensure this works, go to your top-level groupX directory and type “ant compile” – everything should compile just fine.
-From the groupX/lab1 directory, create a subdirectory “test”. Now try “ant junit”. This should work – if it doesn’t troubleshoot the configuration problem.
-Now try “ant findbugs”. This should also work; if it does not let’s troubleshoot.
-When you have verified your local setup works, checkin to SVN. You will need to add the examples and test directories before committing, and also commit the new build.xml.
-Use your partners environment to ensure a clean checkout of your groupX module compiles and runs, and the findbugs and junit targets work in Ant!
Activity: Create a Hudson automatic build job
Now go back to Hudson. From the menu on the left select “New Job”. Name your job “asurite1-asurite2-groupX” and choose “Build a free-style software project.” Now configure the job:
- Under Source Code Management select “Subversion” and enter the appropriate info
- Under Build Triggers select “Poll SCM” and “Build Periodically” and set the time parameters to poll every 2 minutes and build every 5 minutes.
- Under Build choose “Invoke Ant” and list targets “clean compile findbugs junit” in that order.
- Under Post-build Actions choose “Publish Findbugs…” and “Publish JUnit…
and feel free to select e-mail notifications and send to yourselves (and me if you like).
If you struggle with this activity browse over to the Test Report activity and see how it is configured, it is this same exact setup. You can also try the jUnit part first and add findBugs later. If you do this correctly, check it is building every n minutes as you set in step 2, and try to check in some changes to SVN and see if it builds automatically within 2 minutes.
Activity: Install the Hudson status Eclipse plugin
Install the Eclipse plugin from the directions available at
Submission: There is nothing to submit for this lab, I will verify through SVN and Hudson directly.