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 #449 prepare posh runtime for mock #840

Merged

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented Jun 8, 2021

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Branch follows the naming format (iox-#123-this-is-a-branch)
  4. 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)
  5. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  6. Relevant issues are linked
  7. Add sensible notes for the reviewer
  8. All checks have passed (except task-list-completed)
  9. Assign PR to reviewer

Notes for Reviewer

This prepares the PoshRuntime for mocking. PoshRuntime is therefore split into two classes with a mostly abstract PoshRuntime and a the implementation in PoshRuntimeImpl. This makes it quite trivial to create a PoshRuntimeMock. Unfortunately it is quite cumbersome to mock methods with the noexcept specifier with gmock 1.8 and I'd like to switch to gmock 1.10. Since it can take some time till the decision is reached, the preparation work can already be reviewed and merged.

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

References

@elBoberido elBoberido added test A module/integration/stress/etc test for a component technical debt unclean code and design flaws labels Jun 8, 2021
@elBoberido elBoberido self-assigned this Jun 8, 2021
@@ -0,0 +1,574 @@
// Copyright (c) 2019 - 2021 by Robert Bosch GmbH. All rights reserved.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a copy of posh_runtime.cpp. Unfortunately github detects it as new file. The history is preserved and the file should be viewed with an external diff tool

@@ -0,0 +1,122 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a copy of posh_runtime.hpp. Unfortunately github detects it as new file. The history is preserved and the file should be viewed with an external diff tool

@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #840 (a7f2210) into master (7697383) will decrease coverage by 0.09%.
The diff coverage is 63.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #840      +/-   ##
==========================================
- Coverage   75.16%   75.06%   -0.10%     
==========================================
  Files         330      332       +2     
  Lines       11856    11863       +7     
  Branches     2001     2001              
==========================================
- Hits         8911     8905       -6     
- Misses       2178     2190      +12     
- Partials      767      768       +1     
Flag Coverage Δ
unittests 73.92% <58.62%> (-0.10%) ⬇️
unittests_timing 30.86% <14.42%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
iceoryx_posh/source/runtime/shared_memory_user.cpp 0.00% <0.00%> (-5.72%) ⬇️
iceoryx_posh/source/runtime/posh_runtime.cpp 60.00% <50.00%> (-5.97%) ⬇️
iceoryx_posh/source/runtime/posh_runtime_impl.cpp 66.55% <66.55%> (ø)
...posh/include/iceoryx_posh/runtime/posh_runtime.hpp 100.00% <100.00%> (ø)
...osh/source/runtime/posh_runtime_single_process.cpp 78.57% <100.00%> (ø)
iceoryx_hoofs/source/concurrent/loffli.cpp 79.41% <0.00%> (-5.89%) ⬇️
...oryx_posh/source/runtime/ipc_runtime_interface.cpp 56.14% <0.00%> (-5.27%) ⬇️
...nternal/roudi/introspection/port_introspection.inl 71.89% <0.00%> (-0.73%) ⬇️
... and 2 more

@elBoberido elBoberido force-pushed the iox-#449-prepare-PoshRuntime-for-mock branch 2 times, most recently from f36499b to 726a789 Compare June 9, 2021 15:24
@elBoberido elBoberido requested a review from elfenpiff June 10, 2021 10:02
elfenpiff
elfenpiff previously approved these changes Jun 10, 2021
@elBoberido elBoberido force-pushed the iox-#449-prepare-PoshRuntime-for-mock branch from 4eea603 to e521ae3 Compare June 10, 2021 11:43
@elBoberido elBoberido requested a review from elfenpiff June 10, 2021 11:43
elfenpiff
elfenpiff previously approved these changes Jun 10, 2021
Comment on lines 51 to +53
ExampleBaseClass() = default;

virtual ~ExampleBaseClass() = default;
Copy link
Contributor

Choose a reason for hiding this comment

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

noexcept missing for both methods

Copy link
Member Author

Choose a reason for hiding this comment

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

I would suggest to keep it this way. We had issues with some compiler adding noexcept to defaulted ctor/dtor

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was solved and we use everywhere else.

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK we had to remove it at some places due to msvc

@elfenpiff is my knowledge outdated?

@elBoberido elBoberido merged commit eb02564 into eclipse-iceoryx:master Jun 10, 2021
@elBoberido elBoberido deleted the iox-#449-prepare-PoshRuntime-for-mock branch June 10, 2021 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt unclean code and design flaws test A module/integration/stress/etc test for a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PoshRuntime Mock
4 participants