I have a Maven-managed Java project that includes JUnit tests -- nothing unusual. Recently, I started getting broken builds on my machine, but Hudson stayed happy. I realized that I had made a change that broke a unit test, but noticed that Hudson wasn't running the unit test. Most of my tests ran fine, but everything in one of my packages was totally absent. Not listed as 'skipped', but actually missing.
Now, I didn't set up this Hudson instance, and I'm not a guru, so I wasn't sure where to start. In no particular order:
- I looked at the project settings page, and copied the exact Maven command line being used and ran it locally. There are some Hudson-specific profile settings in the POM, so I thought it was worth a shot. Missing tests still run (and fail).
- I tried to look at old executions, to see if maybe it was a recent change. Unfortunately, we only keep 5 old builds, so dead end there.
- I checked the POM carefully to see if anything might ever cause it to exclude tests -- not a Maven genius but I can say pretty confidently that there shouldn't be anything, and anyway it shouldn't matter because of bullet #1
- I downloaded the Hudson workspace. Interestingly, there's a
test-classes
directory under/target
which has.class
files for all the missing tests, but/target/surefire-reports
has no matching output files
I feel like I must be missing some kind of setting somewhere, or at least some kind of logfile that would indicate how this is happening -- maybe the tests are failing so badly as to nuke the Surefire process that invoked them before it can write about the failure? -- but like I said, Hudson newb. What should my next move be?
UPDATE: Installed Jenkins locally and tried to reproduce. I'm losing my mind: it still fails to run quite a few tests, even if I log in myself, go to the Jenkins job workspace, and build
- under my own account
- using my own local m2 repo (from a network drive)
- using the same Maven / Java binaries (from a network drive)
- running the same OS
As far as I can tell, the source on the two machines is identical, my environment should be the same (same account)... I can't think of any differences, except of course that a lot of tests don't run on the Jenkins box.