rostest fails when run using "catkin_make run_tests"
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... .
Would you mind sharing the error output?
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.