Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port execution tests to launch_pytest #749

Closed

Conversation

RobertWilbrandt
Copy link
Collaborator

@RobertWilbrandt RobertWilbrandt commented Jul 20, 2023

Our tests currently have some redundant parts like launch descriptions, service interfaces and initialization code. Before working on more tests i think we should clean that up and make our current tests more maintainable in the process. This should result in the following tasks:

  • Move launch descriptions for just the dashboard client and the full robot driver to robot_launch_descriptions so they can be resued among all tests.
  • Move core rclpy (init, node) into fixtures to replace unittest initialization structure.
  • Move the common robot interfaces (to dashboard client, controller manager, common controllers, ...) into fixtures.
  • Port all tests to use these fixtures.

This also enables easily adding more paremetrization options (like testing all robot models for future moveit tests).

I decided to use logging for all test output instead of (as previously) using the node logger. This allows us to only show logging output from our tests or from the tested ROS nodes based on pytest arguments.

I am not quite happy with having to include * from robot_launch_descriptions in every test file, but i could not find a way to use these launch fixtures without this that did not result in ScopeErrors. The tests also always show a warning Warning: There is no current event loop at the end for me that i don't quite understand yet, but the tests still seem to work fine for me.

"ur_type",
default_value="ur5e",
description="Type/series of used UR robot.",
choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest adding ur20 as well

@RobertWilbrandt
Copy link
Collaborator Author

While adding more fixtures i continuously had problems with execution ordering. In particular, the ordering between new launch configurations and the rclpy fixtures seemed to be broken and i was not able to get the tests running reliably. Some pytest arguments like --setup-plan also just produced errors within launch_pytest.

Given that, i'll close this in favor of #849.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants