Feature Request P3
Status Update
Comments
gm...@google.com <gm...@google.com>
gm...@google.com <gm...@google.com> #2
goapp test -cover
now works as expected as of release 1.9.1 of the Go SDK for App Engine.
now works as expected as of release 1.9.1 of the Go SDK for App Engine.
in...@gmail.com <in...@gmail.com> #3
Are you sure that this works with the Go GAE SDK 1.9.14? I am able to collect coverage stats:
goapp test -cover -test.v=true -test.coverprofile=c.out
[..]
coverage: 53.8% of statements
ok _/var/lib/jenkins/jobs/loyalty/workspace 30.464s
But converting those results to HTML 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)
For more information seehttps://groups.google.com/d/topic/google-appengine-go/G-rvCOP8-Aw/discussion
Thanks,
Ingo
goapp test -cover -test.v=true -test.coverprofile=c.out
[..]
coverage: 53.8% of statements
ok _/var/lib/jenkins/jobs/loyalty/workspace 30.464s
But converting those results to HTML 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)
For more information see
Thanks,
Ingo
gm...@google.com <gm...@google.com> #4
Looks like it broke.
As a temporary workaround, you can edit the resulting "c.out" file and fix the file pathnames...
So, for example, you can change "_/var/lib/jenkins/jobs/loyalty/workspace/app.go"
to "./workspace/app.go" (or whatever it is relative to your current directory) and then you should be able to run the "goapp tool cover -html=c.out" command.
As a temporary workaround, you can edit the resulting "c.out" file and fix the file pathnames...
So, for example, you can change "_/var/lib/jenkins/jobs/loyalty/workspace/app.go"
to "./workspace/app.go" (or whatever it is relative to your current directory) and then you should be able to run the "goapp tool cover -html=c.out" command.
in...@gmail.com <in...@gmail.com> #5
Thanks! Running sed before invoking "goapp tool cover" allows me to view the coverage results:
goapp test -cover -test.v=true -test.coverprofile=c.out
sed -i -e "s#.*/\(.*\.go\)#\./\\1#" c.out
goapp tool cover -html c.out -o coverage.html
goapp test -cover -test.v=true -test.coverprofile=c.out
sed -i -e "s#.*/\(.*\.go\)#\./\\1#" c.out
goapp tool cover -html c.out -o coverage.html
Description
Expected behaviour:
go test -cover should return the coverage report just like go test -cover