I am developing a server with the latest Go GAE SDK. I am running tests after every change:
goapp test -test.v=true
I am using -cover
to record coverage as described by goapp help testflag
:
goapp test -cover -test.v=true -test.coverprofile=c.out
[..]
coverage: 53.8% of statements
ok _/var/lib/jenkins/jobs/loyalty/workspace 30.464s
This completes successfully and prints the percentage of lines covered by tests. However, attempting to visualize the results fails:
goapp tool cover -html=c.out
cover: can't find "app.go": cannot find package "_/home/ingo/git/loyalty/" in any of:
/home/ingo/Downloads/go_appengine_sdk_linux_amd64-1.9.10/go_appengine/goroot/src/pkg/_/home/ingo/git/loyalty (from $GOROOT)
/home/ingo/git/loyalty/src/_/home/ingo/git/loyalty (from $GOPATH)
Does Go's cover tool only work on non-GAE apps? Do I have to package my app differently in order to visualize the coverage results?
I unsuccessfully asked this on golang-nuts before.