Comments (5)
@mattbrictson ah, you are right, I completely forgot we use fakeredis
and not a real one. Created PR to fix this issue and also to stop using fakeredis
from rollout.
Released as part of 2.4.6
from rollout.
Perhaps related, if I run bundle update
on the rollout repository itself and run rspec, rollout's specs currently fail:
Failures:
1) Rollout Check if feature exists it should return true if the feature is exist
Failure/Error: @storage.exists(key(feature))
NoMethodError:
undefined method `>' for true:TrueClass
# ./lib/rollout.rb:299:in `exists?'
# ./spec/rollout_spec.rb:669:in `block (3 levels) in <top (required)>'
2) Rollout Check if feature exists it should return false if the feature is not exist
Failure/Error: @storage.exists(key(feature))
NoMethodError:
undefined method `>' for false:FalseClass
# ./lib/rollout.rb:299:in `exists?'
# ./spec/rollout_spec.rb:673:in `block (3 levels) in <top (required)>'
Finished in 0.58978 seconds (files took 0.16322 seconds to load)
83 examples, 2 failures
Failed examples:
rspec ./spec/rollout_spec.rb:667 # Rollout Check if feature exists it should return true if the feature is exist
rspec ./spec/rollout_spec.rb:672 # Rollout Check if feature exists it should return false if the feature is not exist
Edit: this is unrelated. It is a separate bug in fakeredis.
from rollout.
@mattbrictson thank you for opening the issue.
I would be happy to fix it but that error is actually coming from the redis-rb gem itself from
From: /Users/rene/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/redis-4.2.1/lib/redis.rb:606 Redis#exists?:
603: def exists?(*keys)
604: synchronize do |client|
605: client.call([:exists, *keys]) do |value|
=> 606: value > 0
607: end
608: end
609: end
[2] pry(#<Redis>)> value
=> true
value
is boolean and they are comparing it with 0
If I'm not mistaken, they first need to actually fix #exists?
method before we can update rollout.
from rollout.
I think that is actually due to a bug in fakeredis. If you use the redis 4.2.1 gem directly (i.e. without loading fakeredis), it works as expected:
$ irb
>> require "redis"
true
>> Redis::VERSION
"4.2.1"
>> redis = Redis.new(uri: "redis://127.0.0.1/1")
>> redis.exists?("foo")
false
>>
If you load fakeredis, that is when the error occurs:
$ irb
>> require "redis"
true
>> require "fakeredis"
true
>> redis = Redis.new(uri: "redis://127.0.0.1/1")
>> redis.exists?("foo")
NoMethodError (undefined method `>' for false:FalseClass)
from rollout.
Related Issues (20)
- Missing release tags HOT 1
- Modulus operator does not create uniformly distributed random numbers HOT 1
- Missing dependency on json HOT 2
- Percentage Rollout on rails view HOT 2
- Google Calendar and iCalendar Integration HOT 3
- Cannot remove a rollout flag from the persistent store HOT 1
- Cronometer of Events HOT 1
- Feature request: to_hash method on Rollout class?
- Activate and Deactive methods work. But activate_user and deactivate_user do not. HOT 1
- check current rollout percentage? HOT 2
- Keyboard TAB marker totally absorbed by certain CSS
- Public Interface for deleting feature entries from Redis HOT 2
- Should memoization be used? HOT 5
- Safe to upgrade to 2.5? HOT 1
- Add tag and release for 2.5.0? HOT 2
- Suggest to use a class instead of a global variable for a Rails application HOT 1
- Rollout may break when a group with a | character in the name is activated for a feature with additional data
- Rollout#activate returns false HOT 3
- Redis-rb 5.0+ compatibility HOT 9
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 rollout.