Comments (5)
Hi Fred,
now that is odd...
The problem lies in <%= coverage(source_files).round(2) %>
in the file_list.erb
. Unfortunately, I don't have a clue where that NaN FloatDomainError comes from though.
I don't think this has something to do with Rails 3.0.1 or the simplecov adapters API, since that didn't change since the original implementation.
My best take on this would be that in one of your groups, the LOC count is 0, which would then return Infinity
when calculating the coverage. I fixed that in the corresponding source file in simplecov-html and pushed out 0.3.9 of the gem.
From what I reckon, that won't fix your particular issue though since the exception says "NaN FloatDomainError" - while the issue fixed in 0.3.9 would fix up "Infinity FloatDomainError".
To better diagnose the problem, I'd need to know what's wrong with the number returned by the coverage method.
Could you please open up the gem source file views/file_list.erb and change line four to the following (replace round with inspect)
(<span class="<%= coverage_css_class(coverage(source_files)) %>"><%= coverage(source_files).inspect %>%</span>)
Then have a look around the tab labels for the groups for any anomalies and where those might come from.
On a side note, it would probably be better to use a single adapter for all of your test suites. Since the results of cucumber/rspec get merged after every test run, you could get unexpected results with the cached cucumber results being filtered by the rspec filters when the rspec suite finishes. Just compile all the adapter rules into a single one and use that from both cukes and rspec. Of course, if you don't use result merging, that is unneccessary :)
from simplecov.
Hi, did you manage to resolve this issue? Please let me know so I can close the issue!
from simplecov.
Timeout, closing :)
from simplecov.
Hi, it seems that I have the same problem (ruby 1.9.2 + rails 3.0.4). I did replace the line, but I do not know where to look for the tab labels.
I do not have a custom adapter, but here is the error:
path_to/gems/1.9.1/gems/activesupport-3.0.4/lib/active_support/core_ext/float/rounding.rb:16:in `round': NaN (FloatDomainError)
from path_to/gems/1.9.1/gems/activesupport-3.0.4/lib/active_support/core_ext/float/rounding.rb:16:in `round'
from path_to/gems/1.9.1/gems/activesupport-3.0.4/lib/active_support/core_ext/float/rounding.rb:14:in `round'
from path_to/gems/1.9.1/gems/simplecov-html-0.4.3/lib/simplecov-html.rb:28:in `format'
from path_to/gems/1.9.1/gems/simplecov-0.4.0/lib/simplecov/result.rb:56:in `format!'
from path_to/gems/1.9.1/gems/simplecov-0.4.0/lib/simplecov/configuration.rb:120:in `block in at_exit'
from path_to/gems/1.9.1/gems/simplecov-0.4.0/lib/simplecov.rb:134:in `call'
from path_to/gems/1.9.1/gems/simplecov-0.4.0/lib/simplecov.rb:134:in `block in <top (required)>'
from simplecov.
See #23, thanks to @bborn this should be fixed in 0.4.1 (maybe, hopefully ;)
from simplecov.
Related Issues (20)
- branch coverage data missing after collating .resultset.json in parallel test HOT 2
- allow skipping (unreachable) branch coverage only HOT 10
- option to disable line warnings with `enable_coverage_for_eval` and rails views HOT 3
- Use of ractors makes coverage non-deterministic HOT 3
- Branch coverage for the files which don't have _spec files
- "Coverage report generated" is being written to the stdout stream
- Default configurations around coverage criteria and minimum coverage
- Minor documentation fix
- [Feature Request] Don't require all branches to be covered twice in ensure-blocks HOT 3
- Support for other Parallel Testing gems
- SimpleCov does not fail for low coverage for parallel_tests when using 1 process
- SimpleCov only reports the last controller test and sets to 0.0% all previous results HOT 1
- False positives for `begin` lines, a constant definition, and some heredoc content
- مشکل <3
- Rails 7.1 update => test coverage drop HOT 6
- Coverage changes after each run HOT 1
- 0.22.0 release is missing on GitHub
- Coverage dropped in Rails 7.1 (fixed) HOT 1
- Bad usability on bigger projects (>1000s files)
- README says SimpleCov.start should be called after SimpleCov.at_fork, is it true? HOT 1
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.