ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

rostest fails when run using "catkin_make run_tests"

asked 2016-12-14 11:47:55 -0500

ZdenekM gravatar image

updated 2016-12-21 07:50:44 -0500

Hi all,

I have a node and some_test.test file like this:

<launch>
  <include file="$(find some_package)/launch/node.launch"/> <!-- python node using messages from my_msgs -->
  <test test-name="test_node_api" pkg="some_package" type="test_node_api.py" />
</launch>

The node and test script "test_node_api.py" both import messages from some other package (my_msgs). The node itself works fine (roslaunch some_package node.launch). When I run the test like this:

rostest art_db art_db.test

it also works fine (passes). However, when I use "catkin_make run_tests" the node (in node.launch) fails to start with import error of my_msgs.msg module. What might be wrong?

The CMakeLists.txt file looks like this:

cmake_minimum_required(VERSION 2.8.3)
project(some_package)

find_package(catkin REQUIRED COMPONENTS
  my_msgs
  rospy
  roslint
)

set(ROSLINT_PYTHON_OPTS "--max-line-length=250")
roslint_python()
roslint_add_test()

catkin_package(CATKIN_DEPENDS my_msgs)

include_directories(
  ${catkin_INCLUDE_DIRS}
)

if (CATKIN_ENABLE_TESTING)
  find_package(catkin REQUIRED COMPONENTS rostest roslaunch)
  roslaunch_add_file_check(launch)
  add_rostest(tests/some_test.test)
endif()

UPDATE:

Results can be seen here (some_package is actually art_db): http://pastebin.com/qu7SfLK6 - line 143 says "ImportError: No module named art_msgs.msg". However, if I do "catkin_make" several times, the "catki_make run_tests" eventually gives success. Calling "rostest art_db art_db.test" always leads to success. The package can be found here: https://github.com/ZdenekM/ar-table-i... .

edit retag flag offensive close merge delete

Comments

Would you mind sharing the error output?

130s gravatar image 130s  ( 2016-12-15 20:31:46 -0500 )edit

Similar question found: http://answers.ros.org/question/22054... - however in my case I believe that messages are built but module can't be found for some reason.

ZdenekM gravatar image ZdenekM  ( 2016-12-19 04:08:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-31 03:55:55 -0500

ZdenekM gravatar image
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-12-14 11:47:55 -0500

Seen: 1,836 times

Last updated: Jan 31 '17