Another big step in the last two months, I believe, was setting up a Hudson server. Hudson is a continuous integration server. It provides a web interface to run tasks such as compiling, creating documentation, and running unit tests. These tasks can also be scheduled to run at certain times, and Hudson can also monitor source control systems such as Subversion.
Right now, I have Hudson running on my office workstation, finland.cs. It is behind the CSnet firewall, so to use it, you need to SSH into finland.cs and forward port 8080, e.g. using:
ssh -N -L 8080:finland.cs:8080 mgricken@finland.cs
Then you can connect to the web interface by pointing your browser at http://localhost:8080.
Right now, DrJava, the PLT Utilities, Java Language Levels and DynamicJava are all built and unit-tested within 10 minutes of a commit. Once a week, Hudson also updates the FindBugs static analysis reports (both as HTML for the DrJava website and XML reports that can be browsed in the Hudson web interface), Clover code coverage reports and the Javadocs for all of these projects.
I have set up the schedule so that most of the scheduled tasks happen during the night or on weekends when it’s less likely that I am using my workstation:
Hr | Mon-Fri | Sat | Sun |
0 | DrJava | ||
1 | DynamicJava FindBugs | DrJava FindBugs | |
2 | DynamicJava FindBugs XML | DrJava FindBugs XML | |
3 | DynamicJava Clover | DrJava Clover | |
4 | DynamicJava Javadoc | DrJava Javadoc | |
5 | DynamicJava | ||
6 | DrJava | ||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | |||
14 | |||
15 | |||
16 | |||
17 | |||
18 | DrJava | ||
19 | PLT / JLL | ||
20 | PLT FindBugs | JLL FindBugs | |
21 | PLT FindBugs XML | JLL FindBugs XML | |
22 | PLT Clover | JLL Clover | |
23 | PLT Javadoc | JLL Javadoc |
DrJava is built and unit-tested at least 21 times a week; DynamicJava, the PLT Utilities and the Java Language Levels are built 7 times a week.
Every time a build fails or gets fixed again, Hudson sends out emails. That’s probably the most visible part so far. Unfortunately, we have one bug that happens quite frequently now: Sometimes some objects aren’t garbage-collected as we expect. This problem has been around as long as I can remember, i.e. at least since the beginning of 2006. It is difficult to fix, because we can’t really determine which references prevent garbage collection, and we don’t notice it outside of the unit tests.
There are also some problems with Hudson getting stuck or not being able to allocate an X server for the GUI parts of the unit tests, causing the builds to fail. In general, however, I feel a lot better, knowing that Hudson is there, catching errors usually within 10 minutes. I’m also glad I don’t have to build and copy Javadoc and the different reports manually anymore.
Hudson exports the test results to a Google Calendar (XML), which made it quite easy for me to check that the builds were still on track.
In the future, it would be nice to have Hudson run on a dedicated machine, so it doesn’t interfere with my work. Perhaps when a new machine comes in, we can use my current workstation solely for Hudson.