-
Notifications
You must be signed in to change notification settings - Fork 118
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
test: Test the filesystem package. #881
Comments
Hi @HarikrishnanBalagopal, |
Sure |
Hi @HarikrishnanBalagopal |
Sure, np. Hope you will be able to contribute next year! |
@ritesh-karankal np, You could look at this Hacktoberfest task: #886. |
@HarikrishnanBalagopal Hey, could you assign me this issue |
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 |
@HarikrishnanBalagopal I have raised a PR . Please Review. |
Description
Since Move2Kube moved from v1, v2 and to v3 architecture the test coverage has dropped significantly.
A good candidate for unit tests are the files in the
filesystem
package.It is a core part of Move2Kube's
transform
functionality and yet has no unit tests.https://github.com/konveyor/move2kube/tree/ccc92502e41d67756929f36a9f7c0938bfb58c78/filesystem
This package deals with generating and manipulating files and directories.
It can copy files/directories from a source to a destination.
It can also fill template files before they get copied to their destination.
While copying directories It can also calculate the difference between the source and destination directory and only copy the minimal number of files required.
How to get started
For this issue you should start with some simple tests that creates temporary files and directories and calls the functions on it.
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:
https://github.com/konveyor/move2kube/blob/main/types/collection/cluster_test.go#L28-L105
Some helpful resources on how to write unit tests in Go:
Code to be tested
https://github.com/konveyor/move2kube/tree/ccc92502e41d67756929f36a9f7c0938bfb58c78/filesystem
The text was updated successfully, but these errors were encountered: