configdrive: run unit test only for Linux#2665
Conversation
This runs a platform dependent test only on Linux, otherwise skips. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
763471f to
2d33a64
Compare
DaanHoogland
left a comment
There was a problem hiding this comment.
this should not be a unit test on linux either. mkisofs is available for macos as well. I don't like the trend this is setting. Let's find another solution.
|
I am with this on @DaanHoogland This could only lead to Mac developers thinking everything is just fine and they merge a PR with broken code. |
|
jenkins is failing with this as well now (on #2664): |
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
|
@wido @DaanHoogland I've removed the integration like unit test. @borisstoyanov can you help create a different PR that fixes the configdrive in future? |
|
I'm not sure if I can for unit tests @rhtyd, if you're referring to the component tests maybe we can write them from scratch since they are bond with some nuage utilities and test data, which we don't get with normal marvin installation |
|
@borisstoyanov I was referring to the marvin based integration test (I'm okay if it's a new one or fixing the existing one). |
|
Okay @rhtyd |
|
either jenkins didn't restart or it is still failing on the lack of /usr/bin/genisoimage, whuich seems strange. |
|
testing locally |
|
by the looks of it testAddPasswordAndUserData() has now become an integration type test, consequentially. |
|
@DaanHoogland @wido are you both okay with removal of test and submission of proper integration test in future? I've tried to rekick Jenkins using close+open of the PR but it does do not look like it worked (but Travis got re-kicked). |
|
@rhtyd as a consequence of the original change testAddPasswordAndUserData() is now an integration test as well. Can we change that to an integration test as well? |
|
Well, I would like to see this tested ofcourse, but I'm ok with removal for now. |
|
@DaanHoogland I see, I can do some mocking tomorrow on static methods that should get rid of the integration side of things. |
|
Since this only affects developers (non_linux envs) I've moved it to 4.11.2.0 milestone. I'll get back on this soon (but if I've time, will focus on 4.11.1.0 related issues first). |
|
jenkins fails because of this so I'd say this is high urgency, even when not a blocker. |
|
Folks I am almost finished with unit test for |
|
Okay @rafaelweingartner, feel free to push your changes to this PR. Thanks. |
|
|
||
| assertTrue(createCommand.isCreate()); | ||
| assertTrue(createCommand.getIsoData().length() > 0); | ||
| assertTrue(createCommand.getIsoFile().equals(ConfigDrive.createConfigDrivePath(profile.getInstanceName()))); |
There was a problem hiding this comment.
@DaanHoogland we don't need to remove this unit test, instead just mock the call that addPasswordAndUserdata makes to the ConfigDriveBuilder static method which is tricky but do-able.
There was a problem hiding this comment.
whatever solution is fine by me. for now I want to see jenkins pass. We can revert when we have a better solution.
|
@fmaximus there is a nuage specific config drive test suite. Can you verify that these tstill pass? And do those all need to be nuage specific? Maybe we can generify the config drives ones to run as generic regression tests. |
|
as for running on macos, i think the following might do: I'll test and add to this PR (or separately if we feel it needs to be. |
|
As for @rhtyd 's comment above, after jenkins passes I will revert the removal of the test and extract line 350 of ConfigDriveNetworkElement, , into a separate method to be mocked. That hopefully will do the trick. |
now involved in the code, other reviewers wanted
|
@DaanHoogland I am almost finished with the complete set of unit tests for the static methods as you originally designed this code. Could you just wait a bit more? Therefore, there would be no need to do the changes you are doing here that are intended to facilitate your mocking. I know writing unit tests for static method is a pain, that is why I started doing yesterday, but I was not able to finish yesterday. |
|
@DaanHoogland @borisstoyanov The test in the component directory is a test which can run without any need for Nuage. It started as a copy of the Nuage specific test in plugins/nuagevsp, and recently I have moved the common code to a separate class in the component test, so I can reuse it from the nuage test. PR #2673 has some more fixes for issues I encountered when trying to run it. |
|
Closing this as #2674 addresses the issues. |
|
@DaanHoogland I just saw you had made some additional changes on top of my PR, can you move/check those changes in Rafael's PR in #2674 . |
|
check |
This runs a platform dependent test only on Linux, otherwise skips.
Types of changes
GitHub Issue/PRs
Screenshots (if appropriate):
How Has This Been Tested?
Checklist:
Testing