-
Notifications
You must be signed in to change notification settings - Fork 403
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
Iox #454 enhancing coverage for class roudi and port manager in roudi folder #527
Conversation
Signed-off-by: Jimmy Belloche <[email protected]>
Signed-off-by: Jimmy Belloche <[email protected]>
…roudi_portmanager Signed-off-by: Manel Melaouhi <[email protected]>
…d clean for class roudi_portmanager Signed-off-by: Manel Melaouhi <[email protected]>
…-roudi Signed-off-by: Jimmy Belloche <[email protected]>
Signed-off-by: Manel Melaouhi <[email protected]>
…T_THAT Signed-off-by: Manel Melaouhi <[email protected]>
Signed-off-by: Manel Melaouhi <[email protected]>
@@ -0,0 +1,545 @@ | |||
// Copyright (c) 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. |
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.
Concerning this file, many EXPECT are missing. I am aware but I didn't have any idea how to really check the different tests. On my side, I think it is missing an errorHandler when number of elements is incorrect.
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.
To which number of elements are you referring to?
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.
Sorry, I was not so explicit. In the procesManager method of class Roudi (roudi.cpp), if the message does not contain the correct number of elements depending on the MqMessageType received, an error is set. In my opinion, errohandler could be used there.
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.
ErrorHandler is not used right now. But, I guess it could be a potential improvement of the existing code, correct ?
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.
I guess you refer to the method processMessage
right?
Yes the errorhandler should be used there, but only with level Moderate
because RouDi can proceed and the request from the runtime is not processed.
There is even in one case the errorhandler used:
iceoryx/iceoryx_posh/source/roudi/roudi.cpp
Line 230 in f7fee3c
Error::kPORT_MANAGER__INTROSPECTION_MEMORY_MANAGER_UNAVAILABLE, nullptr, iox::ErrorLevel::MODERATE); |
@elBoberido does it make sense to have an error like Error::kROUDI__WRONG_NUMBER_PARAMETERS_MQMESSAGE
? Or do you want to refactor that too?
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.
I think that's not necessary on the roudi side. It just hast to be communicated back to the application since this is input from an application and therefore the error handler should also be called on the application side.
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.
Does it mean the method process manager should return something ?
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.
This is something that will heavily be refactored with #332 in the future to give the application more information what's going on. As a side effect, this makes testing also easier.
Currently there is no response to the application if the number of parameter don't match. With #332 that will change and an error response will be sent back.
What's even worse, calling the error handler with Error::kPORT_MANAGER__INTROSPECTION_MEMORY_MANAGER_UNAVAILABLE
is definitely wrong and should be removed. The application just provided us with the wrong number of parameter.
Currently the RouDi
class is not really good testable.
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.
Just a few comments, detailed review will follow....
@@ -0,0 +1,545 @@ | |||
// Copyright (c) 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. |
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.
To which number of elements are you referring to?
namespace test | ||
{ | ||
/// @req IOX_SWRS_112, IOX_SWRS_200 | ||
/// @brief Test goal: "This test suite verifies that the BaseClass function is verified" |
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.
Very good! Please fill out the template.
m_roudiApp->shutDownTest(); | ||
} | ||
|
||
/// @note name of the Testcase shall describe the test case in detail to avoid additional comments |
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.
can be removed when the name is meaningful
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.
Most of the tests are missing the verification of the behavior. Please add it.
Yes, I let a comment about it above :) |
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.
All the tests without an EXPECT
give a false feeling of safety because the line coverage is high, but except not crashes, nothing is verified. The RouDi
class is currently not easily testable and needs a refactoring, which will happen in the near future.
Signed-off-by: Jimmy Belloche <[email protected]>
Signed-off-by: Jimmy Belloche <[email protected]>
…nager Signed-off-by: Manel Melaouhi <[email protected]>
…g to the container Signed-off-by: Manel Melaouhi <[email protected]>
…nts and replace EXPECT_* with ASSERT_* for two tests Signed-off-by: Manel Melaouhi <[email protected]>
…ing needed Signed-off-by: Jimmy Belloche <[email protected]>
working on fixing the build |
…yx#454-Enhancing-coverage-for-class-roudi-and-port-manager-in-roudi-folder Signed-off-by: Chiranjeevi Maddi (RBEI/EBB1) <[email protected]>
29836ed
to
5cbd88e
Compare
@elBoberido i pushed some updates :) |
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.
Looking at the existing test in this file makes it a bad example on how to write tests. It seems this file can count as one of our sins from the past.
…ontainer Signed-off-by: Manel Melaouhi <[email protected]>
…the remove with acquire a new one Signed-off-by: Manel Melaouhi <[email protected]>
…roy and cleanup Signed-off-by: Manel Melaouhi <[email protected]>
Signed-off-by: Manel Melaouhi <[email protected]>
@@ -1,4 +1,4 @@ | |||
// Copyright (c) 2019, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. | |||
// Copyright (c) 2019, 2021 by Robert Bosch GmbH. All rights reserved. |
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.
I guess you should add back Apex company.
Signed-off-by: Manel Melaouhi <[email protected]>
Signed-off-by: Manel Melaouhi <[email protected]>
…l lambda. Signed-off-by: Manel Melaouhi <[email protected]>
…lambda Signed-off-by: Manel Melaouhi <[email protected]>
…al lambda Signed-off-by: Manel Melaouhi <[email protected]>
requested changes are pushed :D |
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.
The code is mostly good. Most of the requests are regarding code style and most of that is due to the existing code.
Signed-off-by: Manel Melaouhi <[email protected]>
…marks Signed-off-by: Manel Melaouhi <[email protected]>
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 there
Signed-off-by: Manel Melaouhi <[email protected]>
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.
Looks good. Thank's for the contribution
…-Enhancing-coverage-for-class-roudi-and-port-manager-in-roudi-folder Iox eclipse-iceoryx#454 enhancing coverage for class roudi and port manager in roudi folder
Pre-Review Checklist for the PR Author
iox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)Notes for Reviewer
Code contributed by @JimmyBch @manel94
Checklist for the PR Reviewer
Post-review Checklist for the PR Author
Post-review Checklist for the Eclipse Committer
References