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

Move test_utils module from demos repo #1955

Merged
merged 11 commits into from
Dec 28, 2024
Merged

Move test_utils module from demos repo #1955

merged 11 commits into from
Dec 28, 2024

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented Dec 17, 2024

As integration testing gets more popular I propose to release the test_utils from the ros2_control_demos repository.

I added it to the controller_manager package to be able to use it in the test for the ros2_control_node.
I had to use ament_cmake_pytest instead of launch_testing_ament_cmake, otherwise the coverage was not evaluated of the python files.

Tested with semi-binary builds of ros-controls/ros2_control_demos#673

@christophfroehlich christophfroehlich changed the title Add/test utils Move test_utils module from demos repo Dec 17, 2024
@christophfroehlich christophfroehlich marked this pull request as ready for review December 17, 2024 20:00
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 86.95652% with 12 lines in your changes missing coverage. Please review.

Project coverage is 88.24%. Comparing base (65d4092) to head (7bd97e2).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
...ontroller_manager/controller_manager/test_utils.py 77.35% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1955      +/-   ##
==========================================
+ Coverage   87.73%   88.24%   +0.51%     
==========================================
  Files         122      123       +1     
  Lines       13052    13129      +77     
  Branches     1171     1183      +12     
==========================================
+ Hits        11451    11586     +135     
+ Misses       1169     1093      -76     
- Partials      432      450      +18     
Flag Coverage Δ
unittests 88.24% <86.95%> (+0.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ller_manager/test/test_ros2_control_node_launch.py 100.00% <100.00%> (ø)
...ontroller_manager/controller_manager/test_utils.py 77.35% <77.35%> (ø)

... and 5 files with indirect coverage changes

saikishor
saikishor previously approved these changes Dec 17, 2024
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM. A nice addition

namespace_api = "/"

while time.time() - start < 10.0 and not all(found.values()):
node_names_namespaces = node.get_node_names_and_namespaces()
Copy link
Contributor

Choose a reason for hiding this comment

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

Wasn't that the functionality that was causing trouble for us in the spawner when waiting for the controller manager?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, I can't remember. I added this some time ago in the demo tests, and it seemed to be useful back then ;) maybe the list_controllers service is now more robust and we could skip this node check in advance.

Copy link
Member

Choose a reason for hiding this comment

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

Atleast in the ros2_control_demos, we haven't seen flaky tests due to this right?. We can remove it, if this is not interesting for us to have consistency or we can get back to it when we see some flakiness. Both are fine for me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it didn't make any problems recently

Copy link
Member

Choose a reason for hiding this comment

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

I'll approve it as I don't have a strong opinion on this

@bmagyar bmagyar merged commit efd4c99 into master Dec 28, 2024
25 of 27 checks passed
@bmagyar bmagyar deleted the add/test_utils branch December 28, 2024 10:16
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.

4 participants