ros-industrial-consortium / packml

ROS packml (https://en.wikipedia.org/wiki/PackML) support package
Apache License 2.0
9 stars 14 forks source link

WIP: Initial work on adding packml_stacklight #47

Closed winchesterag closed 5 years ago

winchesterag commented 5 years ago
130s commented 5 years ago

CI failing. E.g. https://travis-ci.org/ros-industrial-consortium/packml/jobs/539897337#L2317

/root/catkin_ws/devel/.private/packml_stacklight/lib/packml_stacklight/packml_stacklight_utest --gtest_output=xml:/root/catkin_ws/build/packml_stacklight/test_results/packml_stacklight/gtest-packml_stacklight_utest.xml
[FATAL] [1559338761.464739287]: ROS_MASTER_URI is not defined in the environment. Either type the following or (preferrably) add this to your ~/.bashrc file in order set up your local machine as a ROS master:
export ROS_MASTER_URI=http://localhost:11311
then, type 'roscore' in another shell to actually launch the master program.
Segmentation fault (core dumped)
:
build/packml_stacklight/test_results/packml_stacklight/MISSING-gtest-packml_stacklight_utest.xml: 1 tests, 0 errors, 1 failures, 0 skipped
Summary: 6 tests, 0 errors, 1 failures, 0 skipped
/root/ici/tests/source_tests.sh: line 244: error: command not found
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Function 'catkin_run_tests' returned with code '127' after 0 min 19 sec

Direct cause is I think a test case code looks for ROS Master but ROS_MASTER_URI environment variable, which tells your ROS programs the location of the Master, is not found. That happened probably because there's ros::init at packml_stacklight/test/test_stacklight.cpp, which I think tries to connect to ROS Master. There seems to be a launch file for testing (test_stacklight.launch), which starts ROS Master, but in your testing setting the launch file isn't used. If you run the launch file, at least you'll see something differently as ROS Master should start.

Configuring rostest and reading its log is tricky, but this on docs.ros.org is the resource I always go back to.