Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Disable VCR when sending coverage and add notes to readme #25

Merged
merged 1 commit into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ export DEBUG_STDOUT=true

You can now check your coverage results in the Codacy dashboard of your project.

## Troubleshoot

**Cannot send coverage when using VCR**

```
require 'vcr'
VCR.configure do |config|
# other config options
c.allow_http_connections_when_no_cassette = false
c.ignore_hosts 'api.codacy.com'
end
```

## What is Codacy?

[Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.
Expand Down
2 changes: 2 additions & 0 deletions lib/codacy/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def self.post_results(parsed_result)
false
else
logger.info('Posting ' + result.to_s.length.to_s + ' bytes to ' + url)
VCR.turn_off! if Object.const_defined?('VCR') && VCR.respond_to?(:turn_off!)
response = send_request(url, result, project_token)
VCR.turn_on! if Object.const_defined?('VCR') && VCR.respond_to?(:turn_on!)

logger.info(response)
response.to_s.include? 'success'
Expand Down