Not Skipping Unit Tests in Sakai – Maven 2

I have been using -Dmaven.skip.test=true for so long in Sakai – I had hard-coded it into my settings.xml

The whole Sakai now compiles with unit tests and the Continuum Build running at Cambridge does its builds with unit tests turned on. Nightly2 does not yet compile with unit tests turned on.

As a developer – you might want to start turning unit tests on or you will break the Cambridge build. I got caught when I checked in something that broke the Continuum build at Cam build but not nightly2. Thanks to Aaron and Ian for being gentle – and thanks to Aaron for his IM advice that led me to the solution below – I felt like I was in Sakai beginner school because I felt so lost.

There are two ways that unit tests get turned off. First, my mvn commands always looked like this:

mvn -Dmaven.test.skip=true -Dmaven.tomcat.home=/Users/cs ….

Just remove the obvious suppression of the tests in your mvn command – but for some of us we just coded it into our settings.xml which is stored in

~/.m2/settings.xml

I had a line that looks like this:

<maven.test.skip>true</maven.test.skip>

Now I have taken it out and joined the ranks of the hip and cool unit testers in Sakai. Also it reduces the number of times I am embarassed when I break the Caret build. Also it means that I am happy to add some stuff to the already existing unit cool tests in the portal made by Ian so my new work is also unit tested.

You might still want to to turn off unit tests when you compile all of Sakai after a fresh checkout – it adds some time to the process. But when you are working on a chunk of Sakai and in particular before you check something in – make sure to pass unit tests before you check new code in.