Skip to content
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

Refactor unit test to not use filesystem #262

Merged
merged 1 commit into from
May 23, 2019
Merged

Conversation

alenkacz
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
Right now the test was directly using os.Stat accessing the filesystem. That's not good idea in unit tests - then it cannot be run in an environment without .kubeconfig at the expected location.
One option I was investigating was using https://github.com/spf13/afero but then I decided to go with no extra dependencies and just refactored the code and test to not use the filesystem.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@alenkacz alenkacz requested a review from kensipe as a code owner May 23, 2019 09:40
Copy link
Member

@gerred gerred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you!

Copy link
Member

@fabianbaier fabianbaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@fabianbaier fabianbaier merged commit bf67c3a into master May 23, 2019
@fabianbaier fabianbaier deleted the av/refactor-fs-test branch May 23, 2019 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants