GithubHelp home page GithubHelp logo

Comments (8)

colszowka avatar colszowka commented on July 30, 2024

Thanks, I've noticed this as well. The command line output wrongly takes the coverage percent from the current result, while the MergedResult from all test suites should be used here.

from simplecov-html.

benhamill avatar benhamill commented on July 30, 2024

Hmm. In the project I was seeing this with, I only have rspec running (so far), so the merged and current should be the same, no?

from simplecov-html.

colszowka avatar colszowka commented on July 30, 2024

Hmm, good point :)

from simplecov-html.

cap10morgan avatar cap10morgan commented on July 30, 2024

I had to commit a patch to simplecov-rcov to make its reported coverage match simplecov-html's. Here's the diff: fguillen/simplecov-rcov@f42eb8e...466446a

I just copied that code straight out of simplecov-html. It seems like this code should be moved up into simplecov, since ideally all formatters would be able to use the same coverage percentage calculation. Then you could just put an accessor on the return results object for the formatter to call.

I can do the work and issue pull requests if you agree with this approach. (Sorry if this thread is about a separate issue, but it seemed like the two problems might be related.)

from simplecov-html.

colszowka avatar colszowka commented on July 30, 2024

So the covered_percent method in the Result class was completely broken, see Issue #19 in simplecov.

This is fixed with 0.4.4, so the reported coverage should be accurate on the command line as well.

The reason this worked in the html formatter is that it uses it's own facilities to calculate coverage since it has to do this for groups individually, while the Result#covered_percent method only works on the whole result set.

As @cap10morgan pointed out correctly, these facilities should be unified and made available in the result class, accepting an array of source files that should be taken into account.

If you want to take a shot on this, go ahead, pull requests are warmly welcomed :)

from simplecov-html.

cap10morgan avatar cap10morgan commented on July 30, 2024

OK, I'll take a crack at it and issue a pull request when I have something working.

from simplecov-html.

cap10morgan avatar cap10morgan commented on July 30, 2024

Sorry for the delay on this, I should have something ready to pull shortly.

from simplecov-html.

cap10morgan avatar cap10morgan commented on July 30, 2024

OK, pull request issued. Let me know if I got the concept right or if you have any issues w/ the implementation.

from simplecov-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.