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

rostest results

asked 2021-04-07 07:26:25 -0500

cronapt gravatar image

Hello

I am trying to get the result of a rostest inside my python test script.

Example:

I am running the rostests on a github action and the issue is that the action would count as passed even if one of the rostests has faild. The command to run the tests is catkin_make run_tests_bo_ros_testing_rostest -j1 2>/dev/null

Is there any solution similar to this

results = rostest.unitrun(PKG, 'goals_tests', 'delocalize_goto', sys.argv)

if (results.wasSuccessful()):
    exit(0)
else:
    exit(1)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-12-03 09:30:15 -0500

Put this command:

catkin_test_results | perl -nlE 'exit 1 if $t ||= m{([1-9]+)(?= errors)}'

It will fail (exit1) if found any number of errors ;)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2021-04-07 07:26:25 -0500

Seen: 240 times

Last updated: Apr 07 '21