Closed plastikfan closed 2 months ago
@plastikfan - json-report
and cover-profile
don’ take full paths, just a single file name. can you please try just
ginkgo run ./... --json-report ginkgo.report -coverpkg=./... -coverprofile=coverage.out
locally and let me know what you see? there should be a ginkgo.report
and a coverage.out
in the directory from which you invoke ginkgo
ok the ginkgo.report file comes out, but still no coverage.out file
ok, great - can you share the command you’re running and all the output that you’re seeing?
ginkgo run ./... --json-report ginkgo.report -coverpkg=./... -coverprofile=coverage.out
Oh and same output as before, everything seems to run ok
you should see a “coverage” percentage at the end of the test run, or a message explaining why coverage wasn’t calculated
actually, also, it’s a small gotcha but can you run
ginkgo -r -json-report ginkgo.report -coverpkg=./... -coverprofile=coverage.out
instead - i just noticed that the list of packages “./…” is to the left of the arguments
Oh jeez, now that does make a difference. I am now seeing the coverage.out file. I recompiled ginkgo with some debug statements which were not coming out beforea and now they are.
So I assume, if I wanted to send those outputs to a different directory, I could use that other flag, I think its output-dir (I need to look this up, but I remember seeing it)
AH found it: --output-dir
and the good thing about ginkgo coverage is that it is way more accurate and less buggy than trying to run coverage with the go test command. This is why I've been determned to get ginkgo coverage working.
Thank you @onsi
hey glad we figured it out!
If I run this locally in my project:
The coverage runs, but there is no output file in localation specified by the coverprofile flag
Listing the contents of the path shows no content.
And actually, there is no ginkgo.report either.
Something weird is happening here, but this looks to be a straight forward use case. I have seen these files created before, but the circumstances are very murky so I can't specify the conditions where it works.
It would also be useful, to explicitly show the location where output files are generated.