Code Monkey home page Code Monkey logo

Comments (5)

colszowka avatar colszowka commented on May 17, 2024

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.

colszowka avatar colszowka commented on May 17, 2024

Hi, did you manage to resolve this issue? Please let me know so I can close the issue!

from simplecov.

colszowka avatar colszowka commented on May 17, 2024

Timeout, closing :)

from simplecov.

mata05 avatar mata05 commented on May 17, 2024

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.

colszowka avatar colszowka commented on May 17, 2024

See #23, thanks to @bborn this should be fixed in 0.4.1 (maybe, hopefully ;)

from simplecov.

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.