-
Notifications
You must be signed in to change notification settings - Fork 373
virtcontainers: Add to bridges unit test #2828
virtcontainers: Add to bridges unit test #2828
Conversation
Thank you for raising your pull request. Please note that the main development of Kata Containers has moved to the 2.0-dev branch of https://github.com/kata-containers/kata-containers repository. The kata-containers/runtime repository is kept for 1.x release maintenance. Please check twice if your change should go to the 2.0-dev branch directly. If it is strongly required for adding the change to Kata Containers 1.x releases, please ping @kata-containers/runtime to assign a dedicated developer to be responsible for porting the change to 2.0-dev branch. Thanks! |
I am still adding to this for more coverage for this unit test but a review is appreciated. |
/test-ubuntu |
Codecov Report
@@ Coverage Diff @@
## master #2828 +/- ##
==========================================
+ Coverage 50.51% 50.65% +0.14%
==========================================
Files 118 118
Lines 17331 17331
==========================================
+ Hits 8754 8779 +25
+ Misses 7503 7478 -25
Partials 1074 1074 |
5d14b6d
to
50a4015
Compare
/test-ubuntu |
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.
A few suggestions but it looks good
50a4015
to
3f9d700
Compare
@jcvenegas I updated the test. I added a test for the default bridge and I think I hit 100% coverage for this specific one. Should I add a test for every parameter? I left |
/test-ubuntu |
Add function that creates new bridges to increase unit test coverage for virtcontainers/types/bridges. Also adds test for address formats. Fixes kata-containers#2827 Signed-off-by: Chelsea Mafrica <[email protected]>
3f9d700
to
e71b05b
Compare
/test-ubuntu |
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.
Thanks @cmaf.
lgtm
Thoughts: The NewBridge()
function is a slightly strange one as it doesn't return an error. That makes it more difficult to unit test since the function itself cannot determine if the returned bridge is valid (which is unfortunate). However, a quick look at the code shows that if you changed NewBridge()
to return an error, that would result in a fair bit of rework since the functions that call NewBridge()
themselves don't return errors 😭
@cmaf - could you port this to the https://github.com/kata-containers/kata-containers/tree/2.0-dev branch too please. |
Ported to 2.0 with 423 |
Add function that creates new bridges to increase unit test coverage
for virtcontainers/types/bridges.
Fixes #2827
Signed-off-by: Chelsea Mafrica [email protected]