Closed HarikrishnanBalagopal closed 5 months ago
@HarikrishnanBalagopal I've written a few (rather simple) go tests so I think I can try to give this a go :)
Hey @HarikrishnanBalagopal Can you assign me so that can raise a Pr
Hey @HarikrishnanBalagopal Can you assign me so that can raise a Pr
Thanks for your interest. I have assigned the issue to you. Feel free to ask in the #konveyor Slack channel to get help https://kubernetes.slack.com/archives/CR85S82A2
hey @HarikrishnanBalagopal, what's the status on the issue
@akagami-harsh Fixed in https://github.com/konveyor/move2kube/pull/994 and https://github.com/konveyor/move2kube/pull/997
Description
Since Move2Kube moved from v1 to v2 and then to the v3 architecture, the test coverage has dropped significantly. One of the many places that need unit tests are the files in the
container
package. It is a core part of Move2Kube'stransform
functionality and yet has only a few unit tests.https://github.com/konveyor/move2kube/blob/6ee8f6be3e7f9b9eb0bb1200b468ac95018f244f/environment/container
This package deals with pulling container images, starting and stopping containers, etc. using different runtimes like Docker and Podman. It can also copy files/directories from the local filesystem into the container and vice versa.
https://github.com/konveyor/move2kube/blob/6ee8f6be3e7f9b9eb0bb1200b468ac95018f244f/environment/container/utils.go
How to get started
For this issue you should start with some simple tests that pulls a container image, starts a container, copies a file into the container, etc. Next step would be to make slight changes to the files in the directory and create a separate subtest for each scenario. Some scenarios that are good to test:
How to add unit tests
Some guidelines:
Some helpful resources on how to write unit tests in Go:
Code to be tested
https://github.com/konveyor/move2kube/blob/6ee8f6be3e7f9b9eb0bb1200b468ac95018f244f/environment/container