Python equivalent of ros2_cpp_test #77
Replies: 4 comments 15 replies
-
You probably can use ros2_test for this. The name of the In both launch testing frameworks, you define the "nodes" (which can be plain executables) you want to test in a "launch description" and then actual tests which can interact with the other processes and/or check some aspect of their execution, such as stdout/stderr output or exit codes. The launch test framework will take care of creating and calling code for the ament setup. If you want to do everything from a single Python file, you can instantiate
And then in
|
Beta Was this translation helpful? Give feedback.
-
Thanks! For some context: I'm testing a class (living in a library) that reads from a bag using In
Your suggestion of using Anyway, I have the following workaround, but it requires a ROS install and isn't trivial to setup in CI. I have to use it as a manual test. Still better than nothing I suppose.
|
Beta Was this translation helpful? Give feedback.
-
I like to think of ros2_ament_setup as of an impl detail: most folks shouldn't need to deal with this. I created #81 where I implemented If you don't involved nodes in a test, ros2_test is an overkill IMO -- takes too much time to get itself set up and you need at least two files instead of one... |
Beta Was this translation helpful? Give feedback.
-
@mvukov if you use try to write to an mcap bag from a
sqlite seems to work fine though. |
Beta Was this translation helpful? Give feedback.
-
Hi- want to say excellent work on this project; it's great.
Quick question: is there a way to run python tests that don't operate on nodes but still need ament setup? Maybe something akin to
ros2_cpp_test
but for python?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions