archived-codacy / ruby-codacy-coverage

DEPRECATED Post coverage results to Codacy
12 stars 11 forks source link

Missing codacy-coverage.log file #17

Closed arthurhuangzh closed 8 years ago

arthurhuangzh commented 8 years ago

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.

pedrorijo91 commented 8 years ago

Hey @arthurhuangzh

Which sequence of commands are you running? Is it a open source project we can have a look at?

arthurhuangzh commented 8 years ago

@pedrorijo91 Hi, thank you for reply, it's a close source project generally just a rails project with Rspec for tests run by parallel_tests, the trigger command is bundle exec rake parallel:spec.

arthurhuangzh commented 8 years ago

and i'm using Coday instead of Codeclimate just replaced below lines in spec_help.rb:

# require 'codeclimate-test-reporter'
# CodeClimate::TestReporter.start
require 'codacy-coverage'
Codacy::Reporter.start

# WebMock.disable_net_connect!(allow_localhost: true, allow: 'codeclimate.com')
WebMock.disable_net_connect!(allow_localhost: true, allow: 'codacy.my-company.com:16006')

run with CODACY_PROJECT_TOKEN CODACY_BASE_API_URL CODACY_RUN_LOCAL envs.

update: the error turns below if run with DEBUG_STDOUT =true:

FATAL -- : wrong argument type nil (expected Regexp) (TypeError)
/gem_volume/gems/codacy-coverage-1.0.0/lib/codacy/parser.rb:11:in `sub'
ENV['RAILS_ENV'] = 'test'
/gem_volume/gems/codacy-coverage-1.0.0/lib/codacy/parser.rb:11:in `block in parse_file'
/gem_volume/gems/codacy-coverage-1.0.0/lib/codacy/parser.rb:10:in `each'
/gem_volume/gems/codacy-coverage-1.0.0/lib/codacy/parser.rb:10:in `map'
/gem_volume/gems/codacy-coverage-1.0.0/lib/codacy/parser.rb:10:in `parse_file'
/gem_volume/gems/codacy-coverage-1.0.0/lib/codacy/formatter.rb:6:in `format'
/gem_volume/gems/simplecov-0.11.2/lib/simplecov/result.rb:47:in `format!'

and get no error if disable Codacy::Reporter.start with same simplecov configs.

pedrorijo91 commented 8 years ago

Have you followed the instructions at https://github.com/codacy/ruby-codacy-coverage/blob/master/README.md ? Can you please activate the debug logs and paste it?

On Monday, 22 August 2016, arthurhuangzh notifications@github.com wrote:

and i'm using Coday instead of Codeclimate just replaced below lines in spec_help.rb:

require 'codeclimate-test-reporter'# CodeClimate::TestReporter.startrequire 'codacy-coverage'Codacy::Reporter.start

WebMock.disable_net_connect!(allow_localhost: true, allow: 'codeclimate.com')WebMock.disable_net_connect!(allow_localhost: true, allow: 'codacy.my-company.com: 16006')

run with CODACY_PROJECT_TOKEN CODACY_BASE_API_URL CODACY_RUN_LOCAL envs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/codacy/ruby-codacy-coverage/issues/17#issuecomment-241304686, or mute the thread https://github.com/notifications/unsubscribe-auth/AB6AylBW9TPEaEzsdDKbsEB98Wp4Mtvvks5qiQ9vgaJpZM4JoRL1 .

Obrigado,

Pedro Rijo

arthurhuangzh commented 8 years ago

@pedrorijo91 i have submitted a PR for fixing and i need this to work without .git because i don't want a big docker image for saving whole git histories, please have a look, thanks in advance.

arthurhuangzh commented 8 years ago

Please fix this ASAP we are waiting for use.

pedrorijo91 commented 8 years ago

Just released a new version: https://rubygems.org/gems/codacy-coverage/versions/1.1.0

arthurhuangzh commented 8 years ago

@pedrorijo91 thanks 👍