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

improve unit test coverage #258

Closed
andyzhangx opened this issue Apr 27, 2020 · 10 comments
Closed

improve unit test coverage #258

andyzhangx opened this issue Apr 27, 2020 · 10 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/test

Comments

@andyzhangx
Copy link
Member

andyzhangx commented Apr 27, 2020

Is your feature request related to a problem?/Why is this needed

Describe the solution you'd like in detail

improve UT coverage including

  • controllerserver
  • nodeserver
  • identityserver
  • version

https://coveralls.io/github/kubernetes-sigs/azurefile-csi-driver?branch=master

image

Describe alternatives you've considered

Additional context

@andyzhangx andyzhangx added kind/test help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Apr 27, 2020
@Dhiraj240
Copy link

@andyzhangx Would like to work on it.

@andyzhangx
Copy link
Member Author

@andyzhangx Would like to work on it.

thanks, this is a big part, just update which part your are working on this issue when you have any progress.

@andyzhangx
Copy link
Member Author

and there are some easy parts, e.g. version.go, this issue is to improve the test code coverage, current ratio is awful, thanks.

@andyzhangx andyzhangx changed the title improve UT coverage improve unit test coverage Apr 29, 2020
@andyzhangx
Copy link
Member Author

cc @kushthedude to take a look, thanks

@animeshk08
Copy link
Contributor

Working on unit tests for https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/pkg/azurefile/nodeserver.go. Mentioning to avoid redundant work :)

@animeshk08
Copy link
Contributor

animeshk08 commented Jun 13, 2020

Update:

Uncovered files:

  • server.go: Need to find a way to mock grpc requests.

Improve coverage:

  • controllerserver.go: Need to create mock file client.
  • nodeserver.go: Mock mount/unmount operation to remove the need of running the tests with root privileges.

@andyzhangx
Copy link
Member Author

thanks @animeshk08 really impressive work!
Can you improve code coverage on csi-common? thanks

Current code coverage:
image

cc @Sakuralbj

@animeshk08
Copy link
Contributor

Sure!
controllerserver-default.go has unimplemented methods which I have omitted. Hence the low coverage for that file.
I will start work on server.go.

@andyzhangx
Copy link
Member Author

it's now 80%!
image

@andyzhangx
Copy link
Member Author

it's now 85%, thanks for the contribution! @animeshk08 now close this issue.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/test
Projects
None yet
Development

No branches or pull requests

3 participants