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

Iox #454 enhancing coverage for class roudi and port manager in roudi folder #527

Conversation

chiranjeevimaddi
Copy link
Contributor

@chiranjeevimaddi chiranjeevimaddi commented Jan 29, 2021

Pre-Review Checklist for the PR Author

  1. Branch follows the naming format (iox-#123-this-is-a-branch)
  2. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  3. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  4. Relevant issues are linked
  5. Add sensible notes for the reviewer
  6. All checks have passed
  7. Assign PR to reviewer

Notes for Reviewer

Code contributed by @JimmyBch @manel94

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

Post-review Checklist for the Eclipse Committer

  1. All checkboxes in the PR checklist are checked or crossed out
  2. Merge

References

@@ -0,0 +1,545 @@
// Copyright (c) 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
Copy link
Contributor

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.

Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Contributor

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 ?

Copy link
Member

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:

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?

Copy link
Member

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.

Copy link
Contributor

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 ?

Copy link
Member

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.

@dkroenke dkroenke self-requested a review January 29, 2021 08:19
@dkroenke dkroenke added the test A module/integration/stress/etc test for a component label Jan 29, 2021
Copy link
Member

@dkroenke dkroenke left a 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.
Copy link
Member

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"
Copy link
Member

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
Copy link
Member

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

@elfenpiff elfenpiff requested a review from marthtz January 29, 2021 08:52
Copy link
Contributor

@elfenpiff elfenpiff left a 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.

@JimmyBch
Copy link
Contributor

Most of the tests are missing the verification of the behavior. Please add it.

Yes, I let a comment about it above :)

Copy link
Member

@elBoberido elBoberido left a 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.

iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi.cpp Outdated Show resolved Hide resolved
@chiranjeevimaddi
Copy link
Contributor Author

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]>
@chiranjeevimaddi chiranjeevimaddi force-pushed the iox-#454-Enhancing-coverage-for-class-roudi-and-port-manager-in-roudi-folder branch from 29836ed to 5cbd88e Compare February 4, 2021 13:41
@manel94
Copy link
Contributor

manel94 commented Feb 4, 2021

@elBoberido i pushed some updates :)

Copy link
Member

@elBoberido elBoberido left a 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.

iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
@@ -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.
Copy link
Contributor

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.

@manel94
Copy link
Contributor

manel94 commented Feb 18, 2021

requested changes are pushed :D

Copy link
Member

@elBoberido elBoberido left a 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.

iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

almost there

iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/test/moduletests/test_roudi_portmanager.cpp Outdated Show resolved Hide resolved
Copy link
Member

@elBoberido elBoberido left a 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

@dkroenke dkroenke dismissed elfenpiff’s stale review February 23, 2021 12:48

Review findings are integrated

@dkroenke dkroenke self-requested a review February 23, 2021 12:48
@elBoberido elBoberido merged commit 05ca913 into eclipse-iceoryx:master Feb 23, 2021
marthtz pushed a commit to boschglobal/iceoryx that referenced this pull request May 12, 2021
…-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test A module/integration/stress/etc test for a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancing Tests in Roudi
7 participants