2
votes

I have a set of NetBeans java projects with dependencies between them. I added the project at the top of the dependency tree to Hudson for continuous integration. Everything works fine, except that the unit tests of dependent projects don't get run by Hudson. This is because the ant scripts that NetBeans creates has dependent projects setup to run the "jar" target and not a target that also runs the unit tests. I could add ant build steps for each dependent project in Hudson to run the unit tests, but I was hoping there's a simpler solution.

2

2 Answers

1
votes

It seems to me like there is no simple solution for this as far as I can tell. My solution will be to use Maven for managing dependencies. This way at I least won't have to manage dependencies redundantly. Both NetBeans and Hudson integrate well with Maven.

0
votes

I presuming you have your main job and all dependent jobs set up separately in Hudson calling the Ant scripts. Hudson must know the dependencies between each individual job. This would be the items under "Build Trigger"->"Build after other projects are built" and "Post-build Actions"->"Build other projects".

Each of those jobs would need to run JUnit tests independently and generate the JUnit XML output to a directory.

You would turn on "Post-build Actions"->"Publish JUnit test result report" in all of your jobs (Main and all dependent ones).

Then in your parent main job, you would enable "Post-build Actions"->"Aggregate downstream test results" to have it coalesce the JUnit output into a result to display for the parent job.

This should give your main job a presentation of all of the test results for the main and any dependent projects.