0

Rosanswers logo

It looks like at present catkin run_tests doesn't run the gradle test command for ROS java projects. Is there any easy way to cause that to happen?

I'd like to be able to use this functionality in the ShadowRobot CI setup on Circle and that invokes catkin run_tests and then handles copying the test reports to where Circle can access them, but this only works for my C++ packages not for my Java ones. Once gradle test is invoked, I can handle putting the results where the ShadowRobot system expects them, but if it's never called there's not much I feel I can do. I'm not fully familiar with Catkin\CMake so I'm curious if I can just add the expected functionality to the CMakeLists.txt in my Java packages somehow without having to modify the whole rosjava Catkin plugin.

Any ideas?


Originally posted by kyle.rush on ROS Answers with karma: 26 on 2017-08-30

Post score: 0

1 Answers1

0

Rosanswers logo

In case anyone was curious, I ended up writing a python script to invoke the gradlew test command, modified my build.gradle to aggregate all the test result xmls into a top level folder, then the python script parses those and aggregates the test case output into a summarized test report and finally writes that test summary to the workspace's build/test_results folder.

I hooked this script into the catkin_make run_tests command via the catkin_add_nosetest(...) option in my Java project CMakeLists.txt. As far as Catkin knows, it's running a python test suite. I just happen to proxy my Java testing through there. It's hacky but it works for now.


Originally posted by kyle.rush with karma: 26 on 2017-08-31

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by jubeira on 2017-11-03:
I've never tried it in a project of my own, but rosjava_core has some tests in the "test" folder that are actually executed when the workspace is built with catkin_make if I am not mistaken. Perhaps that structure can be replicated in your project too.