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

Fix Hardware spawner and add tests for it (backport #1759) #1828

Merged
merged 4 commits into from
Nov 10, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 31, 2024

This basically implements my comments from #1682 (review)

I discussed with @destogl that I would create a new PR including his commit from #1682. So, this effectively replaces #1682.

It basically changes the following things:

  • Actually makes the hardware spawner work. I think it never worked correctly the way it was structured before. (is_hardware_component_loaded checks for one single string, while activate_components and configure_components expect a list.)
  • Fully implement that the hardware spawner allows specifying a list of components that should be started. This is cmdline-interface-breaking (basically only on a parameter description level) change but since it never worked I would expect nobody has been using it so far, so we can safely backport it.
  • Add tests for hardware_spawner (mainly implemented by @destogl)
    This is an automatic backport of pull request Fix Hardware spawner and add tests for it #1759 done by Mergify.

Copy link
Contributor Author

mergify bot commented Oct 31, 2024

Cherry-pick of 5dbd6d5 has failed:

On branch mergify/bp/iron/pr-1759
Your branch is up to date with 'origin/iron'.

You are currently cherry-picking commit 5dbd6d5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   controller_manager/controller_manager/hardware_spawner.py
	modified:   controller_manager/doc/userdoc.rst
	new file:   controller_manager/test/test_hardware_spawner.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   controller_manager/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Oct 31, 2024
@bmagyar bmagyar removed the conflicts label Oct 31, 2024
@christophfroehlich
Copy link
Contributor

@fmauch could you maybe have a look why the test fail on humble?

fmauch and others added 3 commits November 9, 2024 09:01
* Tests for hardware spawner.

* Fully support spawning a list of hardware components

* Use python3 coverage instead of ros2 run in tests

* Actually check component's state after changing it

* Update hardware_spawner's user documentation

---------

Co-authored-by: Dr. Denis Štogl <[email protected]>
Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Christoph Fröhlich <[email protected]>
(cherry picked from commit 5dbd6d5)

# Conflicts:
#	controller_manager/CMakeLists.txt
Copy link

codecov bot commented Nov 10, 2024

Codecov Report

Attention: Patch coverage is 77.53623% with 31 lines in your changes missing coverage. Please review.

Project coverage is 62.96%. Comparing base (9ce8ab3) to head (db456b9).
Report is 2 commits behind head on iron.

Files with missing lines Patch % Lines
controller_manager/test/test_hardware_spawner.cpp 78.81% 7 Missing and 18 partials ⚠️
...ler_manager/controller_manager/hardware_spawner.py 70.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             iron    #1828      +/-   ##
==========================================
+ Coverage   62.31%   62.96%   +0.64%     
==========================================
  Files         112      113       +1     
  Lines       13137    13254     +117     
  Branches     8908     8967      +59     
==========================================
+ Hits         8186     8345     +159     
+ Misses        962      896      -66     
- Partials     3989     4013      +24     
Flag Coverage Δ
unittests 62.96% <77.53%> (+0.64%) ⬆️

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

Files with missing lines Coverage Δ
...ler_manager/controller_manager/hardware_spawner.py 70.23% <70.00%> (+70.23%) ⬆️
controller_manager/test/test_hardware_spawner.cpp 78.81% <78.81%> (ø)

... and 2 files with indirect coverage changes

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

Thx @saikishor for fixing

@christophfroehlich christophfroehlich merged commit a76101d into iron Nov 10, 2024
9 of 12 checks passed
@christophfroehlich christophfroehlich deleted the mergify/bp/iron/pr-1759 branch November 10, 2024 17:04
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