-
Notifications
You must be signed in to change notification settings - Fork 436
Update controller tests to use configure/activate instead of on_configure/on_activate #1682
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
base: master
Are you sure you want to change the base?
Update controller tests to use configure/activate instead of on_configure/on_activate #1682
Conversation
|
This pull request is in conflict. Could you fix it @jsantoso91? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1682 +/- ##
==========================================
+ Coverage 85.25% 85.26% +0.01%
==========================================
Files 143 143
Lines 13794 13794
Branches 1194 1194
==========================================
+ Hits 11760 11762 +2
+ Misses 1636 1633 -3
- Partials 398 399 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
I am looking for feedback before proceeding to edit other tests with similar pattern. |
|
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
|
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
3761a92 to
5b9f14c
Compare
|
Hello, the test results look clean, could I get this PR reviewed? @christophfroehlich @bmagyar |
|
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
|
This pull request is in conflict. Could you fix it @jsantoso91? |
christophfroehlich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, sorry for the very late review.
Second, thanks for picking this :)
The changes itself look great, I just ask to refactor it a bit:
- now we have a mixture of your new helpers and other transitions, where still the state is saved into a variable and then state.id() is evaluated.
- I suggest using the same pattern for every transition. Either
ASSERT_EQ(controller->configure().id(), State::PRIMARY_STATE_INACTIVE);(do we need the helpers, this is simple enough?)- Or use only one helper per transition, and use something like
ASSERT_TRUE(configure_succeeds())orASSERT_FALSE(configure_succeeds()).
Are you still working on OSS/ROS and could finish this?
This could be rolled out to other controllers as well, but let's change it for now only in those you already have touched.
Fix for #1660 and follow up to #1658.
I created helper methods to call configure()/activate() and check expected state (for success and failure) afterwards.
Further replace instances of on_configure() and on_activate() with the said methods.
===
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
To send us a pull request, please:
colcon testandpre-commit run(requires you to install pre-commit bypip3 install pre-commit)