unit test for cmd/completion.go
Need unit test for command completion
Lack of unit test for completion.go is a major contributor to a low overall test coverage score. We need minimum of 80% test coverage to pass a PartyBus mission app pipeline. Overall test coverage can be seen with this command
go test -v ./... -cover
also need test coverage for violations.go
This method does not have test coverage line 384 in code
// find policies with given prefix for command completion
func matchingPolicyNames(factory bbutil.Factory, hint string) ([]string, cobra.ShellCompDirective) {}
More detail of percentage by code file can be seen using the cover test tool
https://medium.com/rungo/unit-testing-made-easy-in-go-25077669318
go test -v ./... -coverprofile=cover.txt
go tool cover -html=cover.txt -o cover.html
And open cover.html in a browser.
Edited by kevin.wilder