-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
A huge advantage of roslibrust is that we can write proper node integration tests, run them "as fast as possible" on a machine, and run them in parallel with no "state leaking" to the host. This is especially cool thanks to tokio's tokio::time::pause() feature.
I'd like to expand the examples in roslibrust/examples to specifically show how to "nicely test" a component. Some very basic examples would be good, but I think folks would appreciate some fairly complex examples.
For each example:
- Write a "node" that is Generic on the
impl roslibrust::Rostrait - Have the node do something moderately complicated (ideally with sleeps and delays using tokio::time)
- Use "#[tokio::test]" to set up some tests of that node, either pass in start_paused or invoke tokio::time::pause() on the first line
- Fixture the node with a MockRos instance in the test
- Make calls and assertions in the test
- Measure how long the test takes to run (will be <1 ms probably).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers