-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add unit tests for command output #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -31,7 +31,7 @@ jobs: | |||
name: "Installing Vendored Dependencies" | |||
command: | | |||
go get -v github.com/golang/dep/cmd/dep | |||
go install github.com/golang/dep/cmd/dep | |||
CGO_ENABLED=0 go install github.com/golang/dep/cmd/dep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a specific flag you needed for building dep
?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
../../../../../usr/local/go/src/net/lookup_unix.go:107:23:warning: undeclared name: cgoLookupPort (interfacer)
../../../../../usr/local/go/src/net/lookup_unix.go:95:24:warning: undeclared name: cgoLookupIP (interfacer)
../../../../../usr/local/go/src/net/lookup_unix.go:80:24:warning: undeclared name: cgoLookupHost (interfacer)
../../../../../usr/local/go/src/net/lookup_unix.go:190:23:warning: undeclared name: cgoLookupPTR (interfacer)
../../../../../usr/local/go/src/net/lookup_unix.go:123:24:warning: undeclared name: cgoLookupCNAME (interfacer)
after doing some searching, that brought me to: alecthomas/gometalinter#149 (comment)
but I looked at the golang:latest
which is being used in CI - it should have gcc
installed, so I tried adding this flag and voilà, it worked!
for d in $(go list ./... | grep -v vendor); do | ||
go test -race -coverprofile=profile.out -covermode=atomic ${d} | ||
if [ -f profile.out ]; then | ||
cat profile.out | awk '{if(NR>1)print}' >> coverage.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might already be the case, but lets see if the coverage report can be in a format and placed in the right place for Circle to parse and display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good thinking. I was gonna look into how to do coverage reporting for Go at some point so we could also get a coverage badge on the repo or something.
related to #72
fixes #122
This PR adds in unit tests for checking the output of the CLI commands.