开发者

Hudson CI project doesn't run NetBeans JUnit tests of dependent projects

开发者 https://www.devze.com 2022-12-26 08:38 出处:网络
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 th

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开发者_如何学JAVA a simpler solution.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消