FAQ
Hi,

I am trying to convert my code coverage results into HTML by running the
following.

$ goapp test -cover -test.v=true -test.coverprofile=c.out
$ goapp tool cover -html=c.out

I am using the Go GAE SDK (extracted to
/Users/ingo/Downloads/go_appengine). I am running this from the root
directory of my GAE app which is located in /Users/ingo/git/loyalty. This
folder contains all my *.go files. All files belong to a package called
"app".

The coverage information is collected just fine. But trying to convert them
into HTML fails with this error:

goapp tool cover -html=c.out
cover: can't find "app.go": cannot find package "_/Users/ingo/git/loyalty/"
in any of:
/Users/ingo/Downloads/go_appengine/goroot/src/pkg/_/Users/ingo/git/loyalty
(from $GOROOT)
/Users/ingo/Downloads/go_appengine/gopath/src/_/Users/ingo/git/loyalty
(from $GOPATH)

What does this mean and how can I fix it?

Thanks,
Ingo

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ingo Jaeckel at Oct 16, 2014 at 11:34 pm
    Is the structure of my app preventing me from running this correctly? Can I
    not use the "app" package that I am currently using? Or do I have to adjust
    my directory structure?

    Is there another way to visualize the coverage results stored in the c.out
    file? I am not sure if the format is Go specific or if this can be parsed
    by existing tools.

    Thanks,
    Ingo
    On Wednesday, October 15, 2014 10:03:00 PM UTC-4, Ingo Jaeckel wrote:

    Hi,

    I am trying to convert my code coverage results into HTML by running the
    following.

    $ goapp test -cover -test.v=true -test.coverprofile=c.out
    $ goapp tool cover -html=c.out

    I am using the Go GAE SDK (extracted to
    /Users/ingo/Downloads/go_appengine). I am running this from the root
    directory of my GAE app which is located in /Users/ingo/git/loyalty. This
    folder contains all my *.go files. All files belong to a package called
    "app".

    The coverage information is collected just fine. But trying to convert
    them into HTML fails with this error:

    goapp tool cover -html=c.out
    cover: can't find "app.go": cannot find package
    "_/Users/ingo/git/loyalty/" in any of:
    /Users/ingo/Downloads/go_appengine/goroot/src/pkg/_/Users/ingo/git/loyalty
    (from $GOROOT)
    /Users/ingo/Downloads/go_appengine/gopath/src/_/Users/ingo/git/loyalty
    (from $GOPATH)

    What does this mean and how can I fix it?

    Thanks,
    Ingo
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tamás Gulácsi at Oct 17, 2014 at 4:28 am
    Just a shot into the dark: try "go" instead of "goapp".

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ingo Jaeckel at Oct 18, 2014 at 3:12 am
    After asking this question
    <https://groups.google.com/forum/#!topic/golang-nuts/9E88H0zkao4> I was
    under the impression I can do this with the Go GAE SDK
    <https://cloud.google.com/appengine/docs/go/>. Are you implying that I the
    coverage results can only be converted to HTML with go instead of Go's GAE
    SDK? If that's true, are there other things that work with go but not with
    goapp?

    Thanks,
    Ingo

    $ goapp
    Go is a tool for managing Go source code.

    Usage:

    goapp command [arguments]

    The commands are:

         serve starts a local development App Engine server
         deploy deploys your application to App Engine
         build compile packages and dependencies
         clean remove object files
         env print Go environment information
         fix run go tool fix on packages
         fmt run gofmt on package sources
         get download and install packages and dependencies
         install compile and install packages and dependencies
         list list packages
         run compile and run Go program
         test test packages
         tool run specified go tool
         version print Go version
         vet run go tool vet on packages

    On Friday, October 17, 2014 12:28:13 AM UTC-4, Tamás Gulácsi wrote:

    Just a shot into the dark: try "go" instead of "goapp".
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ingo Jaeckel at Oct 25, 2014 at 6:12 pm
    Is it possible to collect code coverage information on Go GAE apps?

    Thanks,
    Ingo
    On Friday, October 17, 2014 11:12:12 PM UTC-4, Ingo Jaeckel wrote:

    After asking this question
    <https://groups.google.com/forum/#!topic/golang-nuts/9E88H0zkao4> I was
    under the impression I can do this with the Go GAE SDK
    <https://cloud.google.com/appengine/docs/go/>. Are you implying that I
    the coverage results can only be converted to HTML with go instead of Go's
    GAE SDK? If that's true, are there other things that work with go but not
    with goapp?

    Thanks,
    Ingo

    $ goapp
    Go is a tool for managing Go source code.

    Usage:

    goapp command [arguments]

    The commands are:

    serve starts a local development App Engine server
    deploy deploys your application to App Engine
    build compile packages and dependencies
    clean remove object files
    env print Go environment information
    fix run go tool fix on packages
    fmt run gofmt on package sources
    get download and install packages and dependencies
    install compile and install packages and dependencies
    list list packages
    run compile and run Go program
    test test packages
    tool run specified go tool
    version print Go version
    vet run go tool vet on packages

    On Friday, October 17, 2014 12:28:13 AM UTC-4, Tamás Gulácsi wrote:

    Just a shot into the dark: try "go" instead of "goapp".
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andreas Hulstkamp at Nov 2, 2014 at 10:51 am
    Hi Ingo

    Had trouble figuring this out too.

    It's a 2-step process.


        1. Generate coverfile, SLT:

    * goapp test -coverprofile c.out *
        2. Use the go tool to launch a HTML representation of c.out: SLT:

    *go tool cover -html c.out *

    hth
    Andy

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andreas Hulstkamp at Nov 2, 2014 at 10:58 am
    Also, seems that the paths in your coverfile are invalid. Make them
    relative to the working directory and see if this helps.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • David Cruz at May 14, 2015 at 4:23 am
    Any luck with this yet? I'm facing the same problem... thanks!

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ingo Jaeckel at May 15, 2015 at 1:29 am
    Hey David,

    I posted an update about this on stackoverflow
    <http://stackoverflow.com/questions/26565794/how-to-visualize-code-coverage-information-on-go-gae-apps>.
    There is an open issue
    <https://code.google.com/p/googleappengine/issues/detail?id=10749> related
    to it. As a temporary workaround I am doing the following

    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

    Hope that helps.

    Thanks,
    Ingo
    On Thu, May 14, 2015 at 12:23 AM, David Cruz wrote:

    Any luck with this yet? I'm facing the same problem... thanks!

    --
    You received this message because you are subscribed to a topic in the
    Google Groups "golang-nuts" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/golang-nuts/9UswOWUvktw/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • David Cruz at May 15, 2015 at 2:41 am
    That is perfect! Thanks a lot Ingo... you rock!
    On Thu, May 14, 2015 at 9:29 PM, Ingo Jaeckel wrote:

    Hey David,

    I posted an update about this on stackoverflow
    <http://stackoverflow.com/questions/26565794/how-to-visualize-code-coverage-information-on-go-gae-apps>.
    There is an open issue
    <https://code.google.com/p/googleappengine/issues/detail?id=10749>
    related to it. As a temporary workaround I am doing the following

    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

    Hope that helps.

    Thanks,
    Ingo
    On Thu, May 14, 2015 at 12:23 AM, David Cruz wrote:

    Any luck with this yet? I'm facing the same problem... thanks!

    --
    You received this message because you are subscribed to a topic in the
    Google Groups "golang-nuts" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/golang-nuts/9UswOWUvktw/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 16, '14 at 2:04a
activeMay 15, '15 at 2:41a
posts10
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase