Git Product home page Git Product logo

ruby-codacy-coverage's People

Contributors

andycroll avatar arthurhuangzh avatar caxaria avatar chuckjhardy avatar cog avatar gazeldx avatar geshwho avatar jllopes avatar ljmf00 avatar lolgab avatar machadoit avatar mrfyda avatar nmatpt avatar pedrorijo91 avatar rtfpessoa avatar wojw5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby-codacy-coverage's Issues

Provide information about each branch

There are currently 3 branches:

  • master
  • legacy
  • 1.9.x

What's the difference between them? What is the legacy branch? Is it just a previous version on the tool? Is master for ruby 2.x ?

We need to add some info to the README file so that other users know how to contribute

Rails 5 support

Dependencies need to be updated to work with rails 5

Bundler could not find compatible versions for gem "mime-types":
  In snapshot (Gemfile.lock):
    mime-types (= 3.0)

  In Gemfile:
    rails (< 5.1, >= 5.0.0.beta3) was resolved to 5.0.0.beta3, which depends on
      actionmailer (= 5.0.0.beta3) was resolved to 5.0.0.beta3, which depends on
        mail (>= 2.5.4, ~> 2.5) was resolved to 2.6.4, which depends on
          mime-types (< 4, >= 1.16)

    codacy-coverage was resolved to 0.3.1, which depends on
      rest-client (~> 1.8) was resolved to 1.8.0, which depends on
        mime-types (< 3.0, >= 1.16)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "simplecov":
  In snapshot (Gemfile.lock):
    simplecov (= 0.11.2)

  In Gemfile:
    simplecov

    codacy-coverage was resolved to 0.0.1, which depends on
      simplecov (~> 0.10.0)

Missing changelog

Hi,

I noticed an update on this GEM from 1.1.8 to 2.0.1. It seems like a major change according to your version numbering.

Can you please share a CHANGELOG if we need to change anything in any way, after the upgrade?

Thanks.

rest-client dependency is missing on CI platforms

Hi!

Sad to be the first to report a problem on this gem, but when I setup this gem to report code-coverage, the platform we usually solicit report missing depandency.

Codeship:
upgrade_config___add_codacy_along_codeclimate_for_code_analysis_ _levups_sauron_ _codeship

CircleCI:
levups_sauron__49_-_circleci

When I add rest-client to my Gemfile, tests are fine again.

code coverage push fails for a project with VCR cassettes

Wrap the code coverage push so it turns off VCR exceptions, see

If you don't want to solve this issue at the level of code in this gem, just close this issue. There are options in VCR to ignore it and your documentation could make note of this as a possible problem when using VCR.

Here's a backtrace from a travis build:

I, [2016-11-29T19:27:57.361430 #3953]  INFO -- : Parsing simplecov result to Codacy format...
I, [2016-11-29T19:27:57.400825 #3953]  INFO -- : Preparing payload...
I, [2016-11-29T19:27:57.402613 #3953]  INFO -- : Posting 8002 bytes to https://api.codacy.com/2.0/coverage/b7d28a46f1f5c2893b884f3bd67b25cf8ea8a2e6/ruby
F, [2016-11-29T19:27:57.406366 #3953] FATAL -- : 

================================================================================

An HTTP request has been made that VCR does not know how to handle:

  POST https://api.codacy.com/2.0/coverage/b7d28a46f1f5c2893b884f3bd67b25cf8ea8a2e6/ruby

There is currently no cassette in use. There are a few ways
you can configure VCR to handle this request:
  * If you're surprised VCR is raising this error
    and want insight about how VCR attempted to handle the request,
    you can use the debug_logger configuration option to log more details [1].
  * If you want VCR to record this request and play it back during future test
    runs, you should wrap your test (or this portion of your test) in a
    `VCR.use_cassette` block [2].
  * If you only want VCR to handle requests made while a cassette is in use,
    configure `allow_http_connections_when_no_cassette = true`. VCR will
    ignore this request since it is made when there is no cassette [3].
  * If you want VCR to ignore this request (and others like it), you can
    set an `ignore_request` callback [4].

[1] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/debug-logging
[2] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/getting-started
[3] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/allow-http-connections-when-no-cassette
[4] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/ignore-request

================================================================================

 (VCR::Errors::UnhandledHTTPRequestError)

/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/lib/vcr/request_handler.rb:97:in `on_unhandled_request'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/lib/vcr/library_hooks/webmock.rb:129:in `on_unhandled_request'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/lib/vcr/request_handler.rb:24:in `handle'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/lib/vcr/library_hooks/webmock.rb:144:in `block in <module:WebMock>'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/stub_registry.rb:28:in `block in register_global_stub'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/request_pattern.rb:36:in `matches?'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/stub_registry.rb:58:in `block in request_stub_for'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/stub_registry.rb:57:in `each'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/stub_registry.rb:57:in `detect'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/stub_registry.rb:57:in `request_stub_for'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/stub_registry.rb:50:in `response_for_request'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/webmock-2.1.0/lib/webmock/http_lib_adapters/net_http.rb:79:in `request'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/codacy-coverage-1.1.1/lib/codacy/client.rb:41:in `send_request'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/codacy-coverage-1.1.1/lib/codacy/client.rb:26:in `post_results'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/codacy-coverage-1.1.1/lib/codacy/formatter.rb:7:in `format'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/simplecov-0.12.0/lib/simplecov/result.rb:47:in `format!'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/simplecov-0.12.0/lib/simplecov/configuration.rb:172:in `block in at_exit'
/home/travis/build/dpn-admin/dpn-sync/vendor/bundle/ruby/2.3.0/gems/simplecov-0.12.0/lib/simplecov/defaults.rb:67:in `block in <top (required)>'

Partial Update Support

I wanted to submit a Pull Request to add support for partial updates to the coverage. Without this, we are unable to run a test suite with any amount parallelism, since Codacy will simply take the last coverage report to be the full report.

Can you provide any guidance on how to go about this? Thus far, I am thinking of using a new ENV variable to enable the partial update, and add the partial query parameter to the url accordingly. This way, if there are 2 or more servers running the test suite and the environment variable is appropriately set, each server will provide its partial update.

I am not yet sure how (or where) to go about sending the coverageFinal request to indicate all parts have been sent.

Thanks!

Missing codacy-coverage.log file

I'm integrating Codacy with my ruby project and getting this error

/gems/codacy-coverage-1.0.0/lib/codacy/configuration.rb:25:in `initialize': No such file or directory
@ rb_sysopen - /var/folders/T/codacy-coverage/codacy-coverage_xx/xx/2016.log (Errno::ENOENT)

SimpleCov gem works fine for me.

cannot load rest_client

Hi,

0.1.0...andrebras:0.1.1

Tag 0.1.0 doesn't add rest-client as a runtime dependency. When adding the lines below to your rails_helper.rb or spec_helper.rb:

require 'codacy-coverage'
Codacy::Reporter.start

fails while running specs.

cannot load such file -- rest_client (LoadError)

Cheers.

Undefined local variable or method `url' for Codacy::ClientAPI:Module while pushing results

Hi,
i tried to send my coverage report without success.
I followed the readme instructions, added the env key correctly, but this error appears while connecting to the service

# Running:

......

Finished in 1.807026s, 3.3204 runs/s, 11.6213 assertions/s.

6 runs, 21 assertions, 0 failures, 0 errors, 0 skips
I, [2018-08-11T15:28:36.376402 #23350]  INFO -- : Parsing simplecov result to Codacy format...
I, [2018-08-11T15:28:36.376981 #23350]  INFO -- : Preparing payload...
F, [2018-08-11T15:28:36.380083 #23350] FATAL -- : undefined local variable or method `url' for Codacy::ClientAPI:Module
Did you mean?  URI (NameError)
/home/gianluca/.rvm/gems/ruby-2.3.3/gems/codacy-coverage-2.0.0/lib/codacy/client.rb:25:in `post_results'
/home/gianluca/.rvm/gems/ruby-2.3.3/gems/codacy-coverage-2.0.0/lib/codacy/formatter.rb:7:in `format'
/home/gianluca/.rvm/gems/ruby-2.3.3/gems/simplecov-0.16.1/lib/simplecov/result.rb:48:in `format!'
/home/gianluca/.rvm/gems/ruby-2.3.3/gems/simplecov-0.16.1/lib/simplecov/configuration.rb:182:in `block in at_exit'
/home/gianluca/.rvm/gems/ruby-2.3.3/gems/simplecov-0.16.1/lib/simplecov.rb:200:in `run_exit_tasks!'
/home/gianluca/.rvm/gems/ruby-2.3.3/gems/simplecov-0.16.1/lib/simplecov/defaults.rb:27:in `block in <top (required)>'

this error occurs with this implementation in test_helper.rb (where i try to use both coveralls and codacy reporting system here ) and even with this minimal implementation

require 'codacy-coverage'
Codacy::Reporter.start

require 'opswatch'
require 'minitest/autorun'

$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
GEM_ROOT = File.expand_path('..', __dir__)

coverage badge

Hello guys,
After followed the steps it's created to me folder called coverage contains the files
.last_run.json
.resultset.json
.resultset.json.lock
so how I can now showing the coverage percentage as badge image after that?!

Codacy::Parser breaks when using simplecov 0.18

I'm using codacy-coverage 2.2.0 and I have recently updated simplecov from 0.17 to 0.18 and Codacy coverage reporter starts throwing error after testing:

I, [2020-02-03T14:19:44.876552 #17970]  INFO -- : Parsing simplecov result to Codacy format...
F, [2020-02-03T14:19:44.882050 #17970] FATAL -- : undefined method `>' for #<Array:0x0000562bd59d35d0> (NoMethodError)
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/parser.rb:19:in `block (2 levels) in parse_file'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/parser.rb:19:in `count'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/parser.rb:19:in `block in parse_file'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/parser.rb:10:in `each'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/parser.rb:10:in `map'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/parser.rb:10:in `parse_file'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/codacy-coverage-2.2.0/lib/codacy/formatter.rb:6:in `format'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov/formatter/multi_formatter.rb:10:in `block in format'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov/formatter/multi_formatter.rb:8:in `map'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov/formatter/multi_formatter.rb:8:in `format'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov/result.rb:49:in `format!'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov/configuration.rb:196:in `block in at_exit'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov.rb:201:in `run_exit_tasks!'
/home/long/.rvm/gems/ruby-2.6.5@cems/gems/simplecov-0.18.1/lib/simplecov/defaults.rb:31:in `block in <top (required)>'

After digging in the code, simplecov_result.original_result (in Codacy::Parser) format is found to be changed. In simplecov 0.17, the format is:

simplecov_result.original_result = {
  '/path/to/file' => [nil, 0, 1, nil, 0, 1,...]
}

In version 0.18, this format is changed to:

simplecov_result.original_result = {
  '/path/to/file' => {
    'lines' => [nil, 0, 1, nil, 0, 1,...],
    'branches' => {...},
  }
}

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.