Excluding mocks from coverage reports

I noticed that my coverage reports were including mock packages. To get rid of this instead of running go test like this: go test -race -coverpkg=./... -coverprofile allcoverage1.10rc.out ./... I am now running it like this: CVPKG=$(go list ./... | grep -v mocks | tr '\n' ',') go test -race -coverpkg $CVPKG -coverprofile allcoverage1.10rc.out ./... go list ./... lists all packages in my project; we pipe that through grep -v mocks to exclude mocks; we then pipe that output to tr '\n' ',' to replace newlines (each package is listed on a new line) with commas.

Continue Reading »

Testing SnailLife Go on Go 1.10

This is quick braindump of getting SnailLife Go building and testing on Go 1.10. A few days ago I decided to start building and testing SnailLife Go on Go 1.10 RC 1 (now RC 2). It took a bit of wrangling, but after updating my local environment and finding the best image to use for GitLab CI, I now have it building on Go 1.9 and 1.10 rc 2.

Continue Reading »