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

Commit 09b6c46

Browse files
committed
Disable VCR when sending coverage and add notes to readme
1 parent 30eb884 commit 09b6c46

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ export DEBUG_STDOUT=true
7676

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

79+
## Troubleshoot
80+
81+
**Cannot send coverage when using VCR**
82+
83+
```
84+
require 'vcr'
85+
VCR.configure do |config|
86+
# other config options
87+
c.allow_http_connections_when_no_cassette = false
88+
c.ignore_hosts 'api.codacy.com'
89+
end
90+
```
91+
7992
## What is Codacy?
8093

8194
[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.

lib/codacy/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def self.post_results(parsed_result)
2323
false
2424
else
2525
logger.info('Posting ' + result.to_s.length.to_s + ' bytes to ' + url)
26+
VCR.turn_off! if Object.const_defined?('VCR') && VCR.respond_to?(:turn_off!)
2627
response = send_request(url, result, project_token)
28+
VCR.turn_on! if Object.const_defined?('VCR') && VCR.respond_to?(:turn_on!)
2729

2830
logger.info(response)
2931
response.to_s.include? 'success'

0 commit comments

Comments
 (0)