-
Notifications
You must be signed in to change notification settings - Fork 7
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
hugo/feature/Mock LedKit #1206
hugo/feature/Mock LedKit #1206
Conversation
5811314
to
9d5d337
Compare
File comparision analysis report🔖 Info
Click to show memory sections
📝 SummaryClick to show summary
🗺️ Map files diff outputClick to show diff list
|
File comparision analysis report🔖 Info
Click to show memory sections
📝 SummaryClick to show summary
🗺️ Map files diff outputClick to show diff list
|
Codecov Report
@@ Coverage Diff @@
## develop #1206 +/- ##
========================================
Coverage 96.12% 96.12%
========================================
Files 146 146
Lines 3565 3565
========================================
Hits 3427 3427
Misses 138 138
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
cf44073
to
dd5eaed
Compare
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.
That's some great work! 👍
It shows that the same refactor must be made for other kits to make testing even easier.
#include "interface/libs/VideoKit.h" | ||
|
||
namespace leka { | ||
|
||
class BehaviorKit | ||
{ | ||
public: | ||
explicit BehaviorKit(interface::VideoKit &videokit, LedKit &ledkit, interface::Motor &motor_left, | ||
explicit BehaviorKit(interface::VideoKit &videokit, interface::LedKit &ledkit, interface::Motor &motor_left, |
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.
not related to the PR, but could behaviors depend on motionkit instead of motors? how are motors used here?
CommandKit &cmdkit, RFIDKit &rfidkit, ActivityKit &activitykit) | ||
interface::Motor &motor_right, interface::LED &ears, interface::LED &belt, | ||
interface::LedKit &ledkit, interface::LCD &lcd, interface::VideoKit &videokit, | ||
BehaviorKit &behaviorkit, CommandKit &cmdkit, RFIDKit &rfidkit, ActivityKit &activitykit) |
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.
not related directly but we could also have an interface for behaviorkit, CommandKit, RFIDKit and ActivityKit to make testing easier
EXPECT_CALL(mock_videokit, playVideoOnce); | ||
EXPECT_CALL(mock_motor_left, stop).Times(1); | ||
EXPECT_CALL(mock_motor_right, stop).Times(1); | ||
EXPECT_CALL(mock_motor_left, spin).Times(1); | ||
EXPECT_CALL(mock_motor_right, spin).Times(1); |
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.
not directly related but:
this should be tested with mock::MotionKit now that Reinforcer use MotionKit
this will make everything cleaner -- no need to test the motors are spinning individually when you have the MotionKit::rotate function
EXPECT_CALL(mock_motor_left, stop()).Times(AtLeast(2)); | ||
EXPECT_CALL(mock_motor_right, stop()).Times(AtLeast(2)); |
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.
unrelated question: if MotionKit is running, will this really stop the actuators?
RobotController should also stop MotionKit in this case, no?
dd5eaed
to
9f47dfe
Compare
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.
Set in same commit
- BehaviorKit modifications and BehaviorKit_tests modifications
- ReinforcerKit modifications and ReinforcerKit_tests modifications
--
There is a lot of new Uninteresting mock function call - returning directly.
--
Does it works on the robot?
--
Review done before ac510ed was pushed
d641c2a
to
d928e5e
Compare
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.
Almost good
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.
LGTM 👍
5d61435
to
59d6656
Compare
59d6656
to
776aa06
Compare
62cf717
to
10430ec
Compare
Kudos, SonarCloud Quality Gate passed! |
Mock LedKit to simplify tests using it like BehaviorKit, Reinforcer or more consequently RobotController