Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running against multiple packages, ginkgo --cover should generate a composite coverfile and emit a single coverage percentage #89

Closed
onsi opened this issue Aug 13, 2014 · 9 comments

Comments

@onsi
Copy link
Owner

onsi commented Aug 13, 2014

No description provided.

@onsi
Copy link
Owner Author

onsi commented Aug 13, 2014

Additionally it could be configured to fail if coverage drops?

@onsi onsi changed the title If the Ginkgo CLI detects an existing .coverprofile it should peform a ∆ and report on whether coverage has improved or degraded When running against multiple packages, ginkgo --cover should generate a composite coverfile Aug 28, 2014
@onsi onsi changed the title When running against multiple packages, ginkgo --cover should generate a composite coverfile When running against multiple packages, ginkgo --cover should generate a composite coverfile and emit a single coverage percentage Aug 28, 2014
@onsi onsi removed the v1.2 label Apr 24, 2015
@robdimsdale
Copy link
Contributor

I would like to +1 this.

I'm currently using gover to collect various coverfiles in preparation for sending to a coverage processor (e.g. coveralls.io) and it would be an easier workflow if ginkgo collected them for me.

@tve
Copy link

tve commented Sep 26, 2015

+1 on doing it "right". But I'm not sure there is one right way... I write a lot of high-level functional test and often end up with tests at the top level that really test subpackages. The net effect is that I want coverprofiles to be merged and not just concatenated. The way I do that is my Makefile's cover rule has something like:

        @for f in `find . -name \*.coverprofile`; do tail -n +2 $$f >>_total; done
        @echo 'mode: atomic' >total.coverprofile
        @awk -f merge-profiles.awk <_total >>total.coverprofile

and the awk script to do the merging is:

#! /usr/bin/awk
BEGIN { FS = " " }
NF == 3 {
        k = $1 " " $2;
        if (k in block) block[k] += $3
        else block[k] = $3
}
END {
        for (k in block) {
                print k, block[k]
        }
}

I hope this helps...

@mantzas
Copy link

mantzas commented Mar 27, 2016

+1

@thedodd
Copy link

thedodd commented May 19, 2016

+1 this would be pretty fantastic!

@thedodd
Copy link

thedodd commented May 19, 2016

If someone want's to point out the code which needs focus, I am happy to take a crack at it. Haven't looked at the codebase for this project yet.

@johanbrandhorst
Copy link

What is the status of this? Seems like it would be a nice feature.

@AlexeySoshin
Copy link
Contributor

@onsi I'm thinking of implementing this together with -outputdir, which doesn't work right now, and after PR #355 is merged. WDYT?

@onsi
Copy link
Owner Author

onsi commented Jul 19, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants