Conversation
✅ Deploy Preview for urunc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hello @Mysterio-17 , this PR also has changes from the netkit PR. These are two different PRs and the same changes should not be present in both PRs. Please remove the netkit changes from this PR and take a look in the contribution guide |
31a2818 to
24d5f9f
Compare
|
Hello @cmainas , I’ve removed all netkit-related changes from this PR as suggested, and it now includes only unit test additions. All tests pass successfully, and the commit message has been updated to follow the contribution guidelines. |
cmainas
left a comment
There was a problem hiding this comment.
Hello @Mysterio-17 ,
thank you for this contribution. I have various comments:
- Please use a different method to verify the return values and errors (e.g. assert package) as we do here https://github.com/urunc-dev/urunc/blob/main/pkg/unikontainers/config_test.go. It makes the code cleaner and easier to read for a unit test
- Replace
wantwithexpect
|
Hello @cmainas,
All tests are passing now. Please let me know if any further changes are needed. |
cmainas
left a comment
There was a problem hiding this comment.
Hello @Mysterio-17 ,
thank you for the changes. I have left a few comments. Furthermore, there are two more things that we need to take into consideration:
- We need to add the network_test as a target for init testing in the makefile
- The
isValidSockAddressfunction can change therpcAddressand hence we need to check its value after the call to that function.
|
Hello @cmainas ,
I've run the tests locally, let me know if any changes are required more |
|
Hello @Mysterio-17 , unfortunately, there are still some linting errors that need to be fixed. |
418a220 to
5357037
Compare
|
Hi @cmainas , I tried fixing the linting errors locally, kindly run tests once more so that i can check the issues, if any |
|
Hello @Mysterio-17 , could you please squash your commits? There are commits for netkit and for small changes which do not add value in the commit history. Also, there are still linting issues. You can execute the linter locally with |
5357037 to
84fe16c
Compare
|
Hello @cmainas , I've squashed all commits into a single clean commit and removed all netkit and unnecessary references from the commit history. I also executed the linter locally, Could you please run the tests again |
|
Hello @Mysterio-17 there are some issues with the commit message Also, do not forget to rebase with the main branch of urunc |
0ce55b6 to
425703c
Compare
|
Sure @cmainas , I fixed the header and mispelling and also rebased it with the main branch |
cmainas
left a comment
There was a problem hiding this comment.
Hello @Mysterio-17 ,
I checked the code and I found some small things that need to get addressed.
c8a427e to
fa97c6d
Compare
|
Hello @cmainas , |
|
Hello @Mysterio-17 , now there are multiple new files in this PR, which are unrelated to the PR. |
6b0ac25 to
66e7d74
Compare
|
Hello @cmainas , I apologize for the inconvenience caused by including unrelated files in the previous commits. I have now cleaned the commit history to remove all unrelated files and rebased the branch to resolve the merge conflicts. The PR now contains only the relevant unit test files. |
66e7d74 to
5633f51
Compare
|
Hello @cmainas , I've made the changes, Kindly have a look at this. |
|
Hello @cmainas , I've removed the unused expectedType field as suggested. |
|
Hello @Mysterio-17 , the changes look ok. However, for the merge, please:
|
09e36f8 to
1a3ef06
Compare
|
Hello @cmainas , I've addressed the feedback: added myself to contributors.yaml, fixed the linting error (changed "tests" to "test"), rebased on main, and squashed into a single commit. Kindly have a look at it. |
There was a problem hiding this comment.
Hey @Mysterio-17, it looks like something got mixed up here. The rebase/squash may have introduced some unintended changes, including several typos, version downgrades, and some reverted changes. Could you please review it?
FYI: It might be better to fix the rebase first, which should resolve my comments automatically.
1a3ef06 to
15dc5a5
Compare
cmainas
left a comment
There was a problem hiding this comment.
Thank you @Mysterio-17 for the changes.
|
Sorry for the approval, I thought the tests have been executed. There are some issues with the commit linter. Also, the target for the unit test in the Makefile got removed. Please try to do the changes manually and not with a tool. |
Add unit tests for network, rootfs and vaccel. Signed-off-by: Mradul Tiwari <mradultiwari1708@gmail.com>
15dc5a5 to
014d6d3
Compare
|
Hello @cmainas , I've fixed the rebase to include only the relevant files, shortened the commit message to pass linting, and added test_network target to Makefile. |
Add unit tests for network, rootfs and vaccel. PR: #395 Signed-off-by: Mradul Tiwari <mradultiwari1708@gmail.com> Reviewed-by: Irving Mondragón <mirvingr@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Add unit tests for network, rootfs and vaccel. PR: #395 Signed-off-by: Mradul Tiwari <mradultiwari1708@gmail.com> Reviewed-by: Irving Mondragón <mirvingr@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Add Unit Tests for Vaccel, Network Utils, and Rootfs Selection
Fixes: #96
This PR adds comprehensive unit tests for previously untested functions in the urunc codebase, improving overall test coverage.
Tests Added
pkg/unikontainers/vaccel_test.go (2 test functions, 15 test cases)
TestIdToGuestCID- 4 test cases for deterministic vAccel guest CID generation from container IDsTestIsValidVSockAddress- 11 test cases validating vsock addresses for qemu (vsock://) and firecracker (unix://) formatspkg/unikontainers/rootfs_test.go (3 test functions, 14 test cases)
TestNewRootfsResult- 4 test cases for rootfs result creation (initrd, block, 9pfs, empty)TestRootfsSelector_TryInitrd- 3 test cases for annotation-based initrd path detectionTestRootfsSelector_ShouldMountContainerRootfs- 7 test cases for boolean parsing (true/1/false/0/invalid/empty values)pkg/network/network_test.go (3 test functions, 7 test cases)
TestGetTapIndex- Tests TAP device index extraction from interface namesTestNewNetworkManager- 5 test cases for network manager factory pattern (static/dynamic/invalid)TestEnsureEth0Exists- Tests eth0 interface existence validationSummary