Comments (8)
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.
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.
Hmm, good point :)
from simplecov-html.
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.
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.
OK, I'll take a crack at it and issue a pull request when I have something working.
from simplecov-html.
Sorry for the delay on this, I should have something ready to pull shortly.
from simplecov-html.
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)
- Missed lines color doesn't work for color blind people HOT 1
- jquery-3.4.1 contains vulnerabilities please upgrade to 3.5.1 HOT 6
- Missing asset referenced HOT 1
- Feature proposal: use CDN for assets or put them inline HOT 1
- Feature Request: Update URL with file path. HOT 1
- Feature Request: Silence output_message
- CVE-2022-30123 : rack (2.2.3) HOT 10
- Show test coverage
- Use Float#floor instead of Float#round
- Show loading size
- Fails with `Errno::EACCES: Permission denied @ rb_sysopen` if vendor files are read-only HOT 1
- Symbolic link attack within `coverage` directory can overwrite files elsewhere HOT 1
- New release? HOT 2
- Errors in File.open HOT 2
- Wrong sorting for coverage HOT 6
- Regression: non-ASCII characters are broken HOT 3
- Javascript error in version '0.12.0', some pages cannot be open HOT 15
- Disable pagination HOT 3
- Cannot refresh coverage page directly in version '0.12.0' HOT 4
- Feature proposal: multiple coverages in one html HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplecov-html.