Comments (11)
@ok. I just merged #25 and added a note in the README.
Will be released soon.
from ruby-codacy-coverage.
What would be the easiest solution on our side to fix this? (Ideally not depending on VCR gem)
from ruby-codacy-coverage.
In this gem: test whether VCR is loaded; if so, disable it when doing the post and then enable it again. It might look something like:
VCR.turn_off! if Object.const_defined?('VCR') && VCR.respond_to?(:turn_off!)
# push the coverage data
VCR.turn_on! if Object.const_defined?('VCR') && VCR.respond_to?(:turn_on!)
If that code change works, then the error should be avoided every time, regardless of VCR config changes. AFAIK, the VCR gem is always loaded as VCR
.
For documentation purposes, note that adding an ignore clause to the VCR config can avoid this error, e.g. the following options are working on the project that raised this error:
require 'vcr'
VCR.configure do |config|
# other config options
c.allow_http_connections_when_no_cassette = false
c.ignore_hosts 'api.codacy.com'
end
from ruby-codacy-coverage.
In the first example. Even if we do not require the gem we will be able to invoke a method on it?
from ruby-codacy-coverage.
Yes, there's nothing in that code that requires bundling the VCR gem. It just checks whether the VCR class (which has a constant name of 'VCR') is defined and, if it is, whether it responds to those VCR methods. Test it out to see whether it works without including the VCR gem, it should be OK.
from ruby-codacy-coverage.
We do not have any code using VCR. Are you able to test adding those two lines around https://github.com/codacy/ruby-codacy-coverage/blob/master/lib/codacy/client.rb#L26 locally and see if it works?
from ruby-codacy-coverage.
My only project using codacy currently contains VCR and could not run the test suite easily without it. If you do not have it, that's actually better, because it should not fail without VCR. (Passing the baton back to ya.)
from ruby-codacy-coverage.
@darrenleeweber released as version 1.1.4
let me know if it works.
from ruby-codacy-coverage.
Updating from 1.1.1
to 1.1.4
failed in this travis build
Not sure why exactly, as no other changes were made. There seems to be a residual problem with WebMock that turning off VCR doesn't handle completely. Perhaps the troubleshooting tip in the README is sufficient (and revert this change)? I'm going to check one more thing first.
from ruby-codacy-coverage.
Shoot, this is not working as expected. It may be that the project using both VCR and codacy-coverage needs to take responsibility for this. The easiest solution is already in the README#troubleshooting section. So, recommending scrapping the VCR-toggle solution and releasing a 1.1.5
to replace the 1.1.4
(mistake). Sorry I didn't see that coming.
from ruby-codacy-coverage.
Ok. Just reverted the toggle. 1.1.5
.
from ruby-codacy-coverage.
Related Issues (15)
- rest-client dependency is missing on CI platforms HOT 3
- Rails 5 support HOT 6
- cannot load rest_client HOT 2
- CircleCI multiple containers aggregation example HOT 1
- Missing codacy-coverage.log file HOT 8
- Provide information about each branch HOT 1
- Do not prevent simplecov reports on localhost HOT 10
- Undefined local variable or method `url' for Codacy::ClientAPI:Module while pushing results HOT 1
- Missing changelog HOT 1
- Partial Update Support HOT 3
- coverage badge HOT 2
- Describe Partial Update support in Documentation HOT 2
- gem 0.2.2 does not include fix for stripping carriage returns HOT 1
- Codacy::Parser breaks when using simplecov 0.18 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-codacy-coverage.