redis 3.3.5 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis/Gemfile +8 -1
- data/.travis.yml +34 -62
- data/CHANGELOG.md +45 -2
- data/Gemfile +5 -1
- data/README.md +32 -76
- data/benchmarking/logging.rb +1 -1
- data/bin/build +71 -0
- data/bors.toml +14 -0
- data/lib/redis/client.rb +38 -20
- data/lib/redis/cluster/command.rb +81 -0
- data/lib/redis/cluster/command_loader.rb +32 -0
- data/lib/redis/cluster/key_slot_converter.rb +72 -0
- data/lib/redis/cluster/node.rb +104 -0
- data/lib/redis/cluster/node_key.rb +35 -0
- data/lib/redis/cluster/node_loader.rb +35 -0
- data/lib/redis/cluster/option.rb +76 -0
- data/lib/redis/cluster/slot.rb +69 -0
- data/lib/redis/cluster/slot_loader.rb +47 -0
- data/lib/redis/cluster.rb +285 -0
- data/lib/redis/connection/command_helper.rb +2 -8
- data/lib/redis/connection/hiredis.rb +2 -2
- data/lib/redis/connection/ruby.rb +13 -30
- data/lib/redis/connection/synchrony.rb +12 -4
- data/lib/redis/connection.rb +2 -2
- data/lib/redis/distributed.rb +29 -8
- data/lib/redis/errors.rb +46 -0
- data/lib/redis/hash_ring.rb +20 -64
- data/lib/redis/pipeline.rb +9 -7
- data/lib/redis/version.rb +1 -1
- data/lib/redis.rb +287 -52
- data/makefile +74 -0
- data/redis.gemspec +9 -10
- data/test/bitpos_test.rb +13 -19
- data/test/blocking_commands_test.rb +3 -5
- data/test/client_test.rb +18 -1
- data/test/cluster_abnormal_state_test.rb +38 -0
- data/test/cluster_blocking_commands_test.rb +15 -0
- data/test/cluster_client_internals_test.rb +77 -0
- data/test/cluster_client_key_hash_tags_test.rb +88 -0
- data/test/cluster_client_options_test.rb +147 -0
- data/test/cluster_client_pipelining_test.rb +59 -0
- data/test/cluster_client_replicas_test.rb +36 -0
- data/test/cluster_client_slots_test.rb +94 -0
- data/test/cluster_client_transactions_test.rb +71 -0
- data/test/cluster_commands_on_cluster_test.rb +165 -0
- data/test/cluster_commands_on_connection_test.rb +40 -0
- data/test/cluster_commands_on_geo_test.rb +74 -0
- data/test/cluster_commands_on_hashes_test.rb +11 -0
- data/test/cluster_commands_on_hyper_log_log_test.rb +17 -0
- data/test/cluster_commands_on_keys_test.rb +134 -0
- data/test/cluster_commands_on_lists_test.rb +15 -0
- data/test/cluster_commands_on_pub_sub_test.rb +101 -0
- data/test/cluster_commands_on_scripting_test.rb +56 -0
- data/test/cluster_commands_on_server_test.rb +221 -0
- data/test/cluster_commands_on_sets_test.rb +39 -0
- data/test/cluster_commands_on_sorted_sets_test.rb +35 -0
- data/test/cluster_commands_on_streams_test.rb +196 -0
- data/test/cluster_commands_on_strings_test.rb +15 -0
- data/test/cluster_commands_on_transactions_test.rb +41 -0
- data/test/cluster_commands_on_value_types_test.rb +14 -0
- data/test/command_map_test.rb +3 -5
- data/test/commands_on_geo_test.rb +116 -0
- data/test/commands_on_hashes_test.rb +2 -16
- data/test/commands_on_hyper_log_log_test.rb +3 -17
- data/test/commands_on_lists_test.rb +2 -15
- data/test/commands_on_sets_test.rb +2 -72
- data/test/commands_on_sorted_sets_test.rb +2 -132
- data/test/commands_on_strings_test.rb +2 -96
- data/test/commands_on_value_types_test.rb +80 -6
- data/test/connection_handling_test.rb +5 -7
- data/test/distributed_blocking_commands_test.rb +10 -4
- data/test/distributed_commands_on_hashes_test.rb +16 -5
- data/test/distributed_commands_on_hyper_log_log_test.rb +8 -15
- data/test/distributed_commands_on_lists_test.rb +4 -7
- data/test/distributed_commands_on_sets_test.rb +58 -36
- data/test/distributed_commands_on_sorted_sets_test.rb +51 -10
- data/test/distributed_commands_on_strings_test.rb +30 -10
- data/test/distributed_commands_on_value_types_test.rb +38 -4
- data/test/distributed_commands_requiring_clustering_test.rb +1 -3
- data/test/distributed_connection_handling_test.rb +1 -3
- data/test/distributed_internals_test.rb +8 -19
- data/test/distributed_key_tags_test.rb +4 -6
- data/test/distributed_persistence_control_commands_test.rb +1 -3
- data/test/distributed_publish_subscribe_test.rb +1 -3
- data/test/distributed_remote_server_control_commands_test.rb +1 -3
- data/test/distributed_scripting_test.rb +1 -3
- data/test/distributed_sorting_test.rb +1 -3
- data/test/distributed_test.rb +12 -14
- data/test/distributed_transactions_test.rb +1 -3
- data/test/encoding_test.rb +4 -8
- data/test/error_replies_test.rb +2 -4
- data/test/fork_safety_test.rb +1 -6
- data/test/helper.rb +179 -66
- data/test/helper_test.rb +1 -3
- data/test/internals_test.rb +47 -56
- data/test/lint/blocking_commands.rb +40 -16
- data/test/lint/hashes.rb +41 -0
- data/test/lint/hyper_log_log.rb +15 -1
- data/test/lint/lists.rb +16 -0
- data/test/lint/sets.rb +142 -0
- data/test/lint/sorted_sets.rb +183 -2
- data/test/lint/strings.rb +108 -20
- data/test/lint/value_types.rb +8 -0
- data/test/persistence_control_commands_test.rb +1 -3
- data/test/pipelining_commands_test.rb +12 -8
- data/test/publish_subscribe_test.rb +1 -3
- data/test/remote_server_control_commands_test.rb +60 -3
- data/test/scanning_test.rb +1 -7
- data/test/scripting_test.rb +1 -3
- data/test/sentinel_command_test.rb +1 -3
- data/test/sentinel_test.rb +1 -3
- data/test/sorting_test.rb +1 -3
- data/test/ssl_test.rb +45 -49
- data/test/support/cluster/orchestrator.rb +199 -0
- data/test/support/connection/hiredis.rb +1 -1
- data/test/support/connection/ruby.rb +1 -1
- data/test/support/connection/synchrony.rb +1 -1
- data/test/support/redis_mock.rb +1 -1
- data/test/synchrony_driver.rb +6 -9
- data/test/thread_safety_test.rb +1 -3
- data/test/transactions_test.rb +11 -3
- data/test/unknown_commands_test.rb +1 -3
- data/test/url_param_test.rb +44 -46
- metadata +109 -16
- data/Rakefile +0 -87
data/test/url_param_test.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require File.expand_path("helper", File.dirname(__FILE__))
|
1
|
+
require_relative "helper"
|
4
2
|
|
5
3
|
class TestUrlParam < Test::Unit::TestCase
|
6
4
|
|
@@ -9,104 +7,104 @@ class TestUrlParam < Test::Unit::TestCase
|
|
9
7
|
def test_url_defaults_to_______________
|
10
8
|
redis = Redis.new
|
11
9
|
|
12
|
-
assert_equal "127.0.0.1", redis.
|
13
|
-
assert_equal 6379, redis.
|
14
|
-
assert_equal 0, redis.
|
15
|
-
assert_equal nil, redis.
|
10
|
+
assert_equal "127.0.0.1", redis._client.host
|
11
|
+
assert_equal 6379, redis._client.port
|
12
|
+
assert_equal 0, redis._client.db
|
13
|
+
assert_equal nil, redis._client.password
|
16
14
|
end
|
17
15
|
|
18
16
|
def test_allows_to_pass_in_a_url
|
19
17
|
redis = Redis.new :url => "redis://:secr3t@foo.com:999/2"
|
20
18
|
|
21
|
-
assert_equal "foo.com", redis.
|
22
|
-
assert_equal 999, redis.
|
23
|
-
assert_equal 2, redis.
|
24
|
-
assert_equal "secr3t", redis.
|
19
|
+
assert_equal "foo.com", redis._client.host
|
20
|
+
assert_equal 999, redis._client.port
|
21
|
+
assert_equal 2, redis._client.db
|
22
|
+
assert_equal "secr3t", redis._client.password
|
25
23
|
end
|
26
24
|
|
27
25
|
def test_allows_to_pass_in_a_url_with_string_key
|
28
26
|
redis = Redis.new "url" => "redis://:secr3t@foo.com:999/2"
|
29
27
|
|
30
|
-
assert_equal "foo.com", redis.
|
31
|
-
assert_equal 999, redis.
|
32
|
-
assert_equal 2, redis.
|
33
|
-
assert_equal "secr3t", redis.
|
28
|
+
assert_equal "foo.com", redis._client.host
|
29
|
+
assert_equal 999, redis._client.port
|
30
|
+
assert_equal 2, redis._client.db
|
31
|
+
assert_equal "secr3t", redis._client.password
|
34
32
|
end
|
35
33
|
|
36
34
|
def test_unescape_password_from_url
|
37
35
|
redis = Redis.new :url => "redis://:secr3t%3A@foo.com:999/2"
|
38
36
|
|
39
|
-
assert_equal "secr3t:", redis.
|
37
|
+
assert_equal "secr3t:", redis._client.password
|
40
38
|
end
|
41
39
|
|
42
40
|
def test_unescape_password_from_url_with_string_key
|
43
41
|
redis = Redis.new "url" => "redis://:secr3t%3A@foo.com:999/2"
|
44
42
|
|
45
|
-
assert_equal "secr3t:", redis.
|
43
|
+
assert_equal "secr3t:", redis._client.password
|
46
44
|
end
|
47
45
|
|
48
46
|
def test_does_not_unescape_password_when_explicitly_passed
|
49
47
|
redis = Redis.new :url => "redis://:secr3t%3A@foo.com:999/2", :password => "secr3t%3A"
|
50
48
|
|
51
|
-
assert_equal "secr3t%3A", redis.
|
49
|
+
assert_equal "secr3t%3A", redis._client.password
|
52
50
|
end
|
53
51
|
|
54
52
|
def test_does_not_unescape_password_when_explicitly_passed_with_string_key
|
55
53
|
redis = Redis.new :url => "redis://:secr3t%3A@foo.com:999/2", "password" => "secr3t%3A"
|
56
54
|
|
57
|
-
assert_equal "secr3t%3A", redis.
|
55
|
+
assert_equal "secr3t%3A", redis._client.password
|
58
56
|
end
|
59
57
|
|
60
58
|
def test_override_url_if_path_option_is_passed
|
61
59
|
redis = Redis.new :url => "redis://:secr3t@foo.com/foo:999/2", :path => "/tmp/redis.sock"
|
62
60
|
|
63
|
-
assert_equal "/tmp/redis.sock", redis.
|
64
|
-
assert_equal nil, redis.
|
65
|
-
assert_equal nil, redis.
|
61
|
+
assert_equal "/tmp/redis.sock", redis._client.path
|
62
|
+
assert_equal nil, redis._client.host
|
63
|
+
assert_equal nil, redis._client.port
|
66
64
|
end
|
67
65
|
|
68
66
|
def test_override_url_if_path_option_is_passed_with_string_key
|
69
67
|
redis = Redis.new :url => "redis://:secr3t@foo.com/foo:999/2", "path" => "/tmp/redis.sock"
|
70
68
|
|
71
|
-
assert_equal "/tmp/redis.sock", redis.
|
72
|
-
assert_equal nil, redis.
|
73
|
-
assert_equal nil, redis.
|
69
|
+
assert_equal "/tmp/redis.sock", redis._client.path
|
70
|
+
assert_equal nil, redis._client.host
|
71
|
+
assert_equal nil, redis._client.port
|
74
72
|
end
|
75
73
|
|
76
74
|
def test_overrides_url_if_another_connection_option_is_passed
|
77
75
|
redis = Redis.new :url => "redis://:secr3t@foo.com:999/2", :port => 1000
|
78
76
|
|
79
|
-
assert_equal "foo.com", redis.
|
80
|
-
assert_equal 1000, redis.
|
81
|
-
assert_equal 2, redis.
|
82
|
-
assert_equal "secr3t", redis.
|
77
|
+
assert_equal "foo.com", redis._client.host
|
78
|
+
assert_equal 1000, redis._client.port
|
79
|
+
assert_equal 2, redis._client.db
|
80
|
+
assert_equal "secr3t", redis._client.password
|
83
81
|
end
|
84
82
|
|
85
83
|
def test_overrides_url_if_another_connection_option_is_passed_with_string_key
|
86
84
|
redis = Redis.new :url => "redis://:secr3t@foo.com:999/2", "port" => 1000
|
87
85
|
|
88
|
-
assert_equal "foo.com", redis.
|
89
|
-
assert_equal 1000, redis.
|
90
|
-
assert_equal 2, redis.
|
91
|
-
assert_equal "secr3t", redis.
|
86
|
+
assert_equal "foo.com", redis._client.host
|
87
|
+
assert_equal 1000, redis._client.port
|
88
|
+
assert_equal 2, redis._client.db
|
89
|
+
assert_equal "secr3t", redis._client.password
|
92
90
|
end
|
93
91
|
|
94
92
|
def test_does_not_overrides_url_if_a_nil_option_is_passed
|
95
93
|
redis = Redis.new :url => "redis://:secr3t@foo.com:999/2", :port => nil
|
96
94
|
|
97
|
-
assert_equal "foo.com", redis.
|
98
|
-
assert_equal 999, redis.
|
99
|
-
assert_equal 2, redis.
|
100
|
-
assert_equal "secr3t", redis.
|
95
|
+
assert_equal "foo.com", redis._client.host
|
96
|
+
assert_equal 999, redis._client.port
|
97
|
+
assert_equal 2, redis._client.db
|
98
|
+
assert_equal "secr3t", redis._client.password
|
101
99
|
end
|
102
100
|
|
103
101
|
def test_does_not_overrides_url_if_a_nil_option_is_passed_with_string_key
|
104
102
|
redis = Redis.new :url => "redis://:secr3t@foo.com:999/2", "port" => nil
|
105
103
|
|
106
|
-
assert_equal "foo.com", redis.
|
107
|
-
assert_equal 999, redis.
|
108
|
-
assert_equal 2, redis.
|
109
|
-
assert_equal "secr3t", redis.
|
104
|
+
assert_equal "foo.com", redis._client.host
|
105
|
+
assert_equal 999, redis._client.port
|
106
|
+
assert_equal 2, redis._client.db
|
107
|
+
assert_equal "secr3t", redis._client.password
|
110
108
|
end
|
111
109
|
|
112
110
|
def test_does_not_modify_the_passed_options
|
@@ -122,10 +120,10 @@ class TestUrlParam < Test::Unit::TestCase
|
|
122
120
|
|
123
121
|
redis = Redis.new
|
124
122
|
|
125
|
-
assert_equal "foo.com", redis.
|
126
|
-
assert_equal 999, redis.
|
127
|
-
assert_equal 2, redis.
|
128
|
-
assert_equal "secr3t", redis.
|
123
|
+
assert_equal "foo.com", redis._client.host
|
124
|
+
assert_equal 999, redis._client.port
|
125
|
+
assert_equal 2, redis._client.db
|
126
|
+
assert_equal "secr3t", redis._client.password
|
129
127
|
|
130
128
|
ENV.delete("REDIS_URL")
|
131
129
|
end
|
@@ -133,6 +131,6 @@ class TestUrlParam < Test::Unit::TestCase
|
|
133
131
|
def test_defaults_to_localhost
|
134
132
|
redis = Redis.new(:url => "redis:///")
|
135
133
|
|
136
|
-
assert_equal "127.0.0.1", redis.
|
134
|
+
assert_equal "127.0.0.1", redis._client.host
|
137
135
|
end
|
138
136
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,40 +16,67 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date:
|
19
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: test-unit
|
23
23
|
requirement: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 3.1.5
|
28
28
|
type: :development
|
29
29
|
prerelease: false
|
30
30
|
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 3.1.5
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
36
|
+
name: mocha
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: '0'
|
42
42
|
type: :development
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: '0'
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: hiredis
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: em-synchrony
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
49
77
|
description: |2
|
50
78
|
A Ruby client that tries to match Redis' API one-to-one, while still
|
51
|
-
providing an idiomatic interface.
|
52
|
-
client-side sharding, pipelining, and an obsession for performance.
|
79
|
+
providing an idiomatic interface.
|
53
80
|
email:
|
54
81
|
- redis-db@googlegroups.com
|
55
82
|
executables: []
|
@@ -64,12 +91,13 @@ files:
|
|
64
91
|
- Gemfile
|
65
92
|
- LICENSE
|
66
93
|
- README.md
|
67
|
-
- Rakefile
|
68
94
|
- benchmarking/logging.rb
|
69
95
|
- benchmarking/pipeline.rb
|
70
96
|
- benchmarking/speed.rb
|
71
97
|
- benchmarking/suite.rb
|
72
98
|
- benchmarking/worker.rb
|
99
|
+
- bin/build
|
100
|
+
- bors.toml
|
73
101
|
- examples/basic.rb
|
74
102
|
- examples/consistency.rb
|
75
103
|
- examples/dist_redis.rb
|
@@ -84,6 +112,16 @@ files:
|
|
84
112
|
- examples/unicorn/unicorn.rb
|
85
113
|
- lib/redis.rb
|
86
114
|
- lib/redis/client.rb
|
115
|
+
- lib/redis/cluster.rb
|
116
|
+
- lib/redis/cluster/command.rb
|
117
|
+
- lib/redis/cluster/command_loader.rb
|
118
|
+
- lib/redis/cluster/key_slot_converter.rb
|
119
|
+
- lib/redis/cluster/node.rb
|
120
|
+
- lib/redis/cluster/node_key.rb
|
121
|
+
- lib/redis/cluster/node_loader.rb
|
122
|
+
- lib/redis/cluster/option.rb
|
123
|
+
- lib/redis/cluster/slot.rb
|
124
|
+
- lib/redis/cluster/slot_loader.rb
|
87
125
|
- lib/redis/connection.rb
|
88
126
|
- lib/redis/connection/command_helper.rb
|
89
127
|
- lib/redis/connection/hiredis.rb
|
@@ -96,11 +134,38 @@ files:
|
|
96
134
|
- lib/redis/pipeline.rb
|
97
135
|
- lib/redis/subscribe.rb
|
98
136
|
- lib/redis/version.rb
|
137
|
+
- makefile
|
99
138
|
- redis.gemspec
|
100
139
|
- test/bitpos_test.rb
|
101
140
|
- test/blocking_commands_test.rb
|
102
141
|
- test/client_test.rb
|
142
|
+
- test/cluster_abnormal_state_test.rb
|
143
|
+
- test/cluster_blocking_commands_test.rb
|
144
|
+
- test/cluster_client_internals_test.rb
|
145
|
+
- test/cluster_client_key_hash_tags_test.rb
|
146
|
+
- test/cluster_client_options_test.rb
|
147
|
+
- test/cluster_client_pipelining_test.rb
|
148
|
+
- test/cluster_client_replicas_test.rb
|
149
|
+
- test/cluster_client_slots_test.rb
|
150
|
+
- test/cluster_client_transactions_test.rb
|
151
|
+
- test/cluster_commands_on_cluster_test.rb
|
152
|
+
- test/cluster_commands_on_connection_test.rb
|
153
|
+
- test/cluster_commands_on_geo_test.rb
|
154
|
+
- test/cluster_commands_on_hashes_test.rb
|
155
|
+
- test/cluster_commands_on_hyper_log_log_test.rb
|
156
|
+
- test/cluster_commands_on_keys_test.rb
|
157
|
+
- test/cluster_commands_on_lists_test.rb
|
158
|
+
- test/cluster_commands_on_pub_sub_test.rb
|
159
|
+
- test/cluster_commands_on_scripting_test.rb
|
160
|
+
- test/cluster_commands_on_server_test.rb
|
161
|
+
- test/cluster_commands_on_sets_test.rb
|
162
|
+
- test/cluster_commands_on_sorted_sets_test.rb
|
163
|
+
- test/cluster_commands_on_streams_test.rb
|
164
|
+
- test/cluster_commands_on_strings_test.rb
|
165
|
+
- test/cluster_commands_on_transactions_test.rb
|
166
|
+
- test/cluster_commands_on_value_types_test.rb
|
103
167
|
- test/command_map_test.rb
|
168
|
+
- test/commands_on_geo_test.rb
|
104
169
|
- test/commands_on_hashes_test.rb
|
105
170
|
- test/commands_on_hyper_log_log_test.rb
|
106
171
|
- test/commands_on_lists_test.rb
|
@@ -154,6 +219,7 @@ files:
|
|
154
219
|
- test/sentinel_test.rb
|
155
220
|
- test/sorting_test.rb
|
156
221
|
- test/ssl_test.rb
|
222
|
+
- test/support/cluster/orchestrator.rb
|
157
223
|
- test/support/connection/hiredis.rb
|
158
224
|
- test/support/connection/ruby.rb
|
159
225
|
- test/support/connection/synchrony.rb
|
@@ -187,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
253
|
requirements:
|
188
254
|
- - ">="
|
189
255
|
- !ruby/object:Gem::Version
|
190
|
-
version:
|
256
|
+
version: 2.2.2
|
191
257
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
258
|
requirements:
|
193
259
|
- - ">="
|
@@ -203,7 +269,33 @@ test_files:
|
|
203
269
|
- test/bitpos_test.rb
|
204
270
|
- test/blocking_commands_test.rb
|
205
271
|
- test/client_test.rb
|
272
|
+
- test/cluster_abnormal_state_test.rb
|
273
|
+
- test/cluster_blocking_commands_test.rb
|
274
|
+
- test/cluster_client_internals_test.rb
|
275
|
+
- test/cluster_client_key_hash_tags_test.rb
|
276
|
+
- test/cluster_client_options_test.rb
|
277
|
+
- test/cluster_client_pipelining_test.rb
|
278
|
+
- test/cluster_client_replicas_test.rb
|
279
|
+
- test/cluster_client_slots_test.rb
|
280
|
+
- test/cluster_client_transactions_test.rb
|
281
|
+
- test/cluster_commands_on_cluster_test.rb
|
282
|
+
- test/cluster_commands_on_connection_test.rb
|
283
|
+
- test/cluster_commands_on_geo_test.rb
|
284
|
+
- test/cluster_commands_on_hashes_test.rb
|
285
|
+
- test/cluster_commands_on_hyper_log_log_test.rb
|
286
|
+
- test/cluster_commands_on_keys_test.rb
|
287
|
+
- test/cluster_commands_on_lists_test.rb
|
288
|
+
- test/cluster_commands_on_pub_sub_test.rb
|
289
|
+
- test/cluster_commands_on_scripting_test.rb
|
290
|
+
- test/cluster_commands_on_server_test.rb
|
291
|
+
- test/cluster_commands_on_sets_test.rb
|
292
|
+
- test/cluster_commands_on_sorted_sets_test.rb
|
293
|
+
- test/cluster_commands_on_streams_test.rb
|
294
|
+
- test/cluster_commands_on_strings_test.rb
|
295
|
+
- test/cluster_commands_on_transactions_test.rb
|
296
|
+
- test/cluster_commands_on_value_types_test.rb
|
206
297
|
- test/command_map_test.rb
|
298
|
+
- test/commands_on_geo_test.rb
|
207
299
|
- test/commands_on_hashes_test.rb
|
208
300
|
- test/commands_on_hyper_log_log_test.rb
|
209
301
|
- test/commands_on_lists_test.rb
|
@@ -257,6 +349,7 @@ test_files:
|
|
257
349
|
- test/sentinel_test.rb
|
258
350
|
- test/sorting_test.rb
|
259
351
|
- test/ssl_test.rb
|
352
|
+
- test/support/cluster/orchestrator.rb
|
260
353
|
- test/support/connection/hiredis.rb
|
261
354
|
- test/support/connection/ruby.rb
|
262
355
|
- test/support/connection/synchrony.rb
|
data/Rakefile
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
require "rake/testtask"
|
2
|
-
|
3
|
-
ENV["REDIS_BRANCH"] ||= "unstable"
|
4
|
-
|
5
|
-
REDIS_DIR = File.expand_path(File.join("..", "test"), __FILE__)
|
6
|
-
REDIS_CNF = File.join(REDIS_DIR, "test.conf")
|
7
|
-
REDIS_CNF_TEMPLATE = File.join(REDIS_DIR, "test.conf.erb")
|
8
|
-
REDIS_PID = File.join(REDIS_DIR, "db", "redis.pid")
|
9
|
-
REDIS_LOG = File.join(REDIS_DIR, "db", "redis.log")
|
10
|
-
REDIS_SOCKET = File.join(REDIS_DIR, "db", "redis.sock")
|
11
|
-
BINARY = "tmp/redis-#{ENV["REDIS_BRANCH"]}/src/redis-server"
|
12
|
-
|
13
|
-
task :default => :run
|
14
|
-
|
15
|
-
desc "Run tests and manage server start/stop"
|
16
|
-
task :run => [:start, :test, :stop]
|
17
|
-
|
18
|
-
desc "Start the Redis server"
|
19
|
-
task :start => [BINARY, REDIS_CNF] do
|
20
|
-
sh "#{BINARY} --version"
|
21
|
-
|
22
|
-
redis_running = \
|
23
|
-
begin
|
24
|
-
File.exists?(REDIS_PID) && Process.kill(0, File.read(REDIS_PID).to_i)
|
25
|
-
rescue Errno::ESRCH
|
26
|
-
FileUtils.rm REDIS_PID
|
27
|
-
false
|
28
|
-
end
|
29
|
-
|
30
|
-
unless redis_running
|
31
|
-
unless system("#{BINARY} #{REDIS_CNF}")
|
32
|
-
abort "could not start redis-server"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
at_exit do
|
37
|
-
Rake::Task["stop"].invoke
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
desc "Stop the Redis server"
|
42
|
-
task :stop do
|
43
|
-
if File.exists?(REDIS_PID)
|
44
|
-
Process.kill "INT", File.read(REDIS_PID).to_i
|
45
|
-
FileUtils.rm REDIS_PID
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Clean up testing artifacts"
|
50
|
-
task :clean do
|
51
|
-
FileUtils.rm_f(BINARY)
|
52
|
-
FileUtils.rm_f(REDIS_CNF)
|
53
|
-
end
|
54
|
-
|
55
|
-
file BINARY do
|
56
|
-
branch = ENV.fetch("REDIS_BRANCH")
|
57
|
-
|
58
|
-
sh <<-SH
|
59
|
-
mkdir -p tmp;
|
60
|
-
cd tmp;
|
61
|
-
rm -rf redis-#{branch};
|
62
|
-
wget https://github.com/antirez/redis/archive/#{branch}.tar.gz -O #{branch}.tar.gz;
|
63
|
-
tar xf #{branch}.tar.gz;
|
64
|
-
cd redis-#{branch};
|
65
|
-
make
|
66
|
-
SH
|
67
|
-
end
|
68
|
-
|
69
|
-
file REDIS_CNF => [REDIS_CNF_TEMPLATE, __FILE__] do |t|
|
70
|
-
require 'erb'
|
71
|
-
|
72
|
-
erb = t.prerequisites[0]
|
73
|
-
template = File.read(erb)
|
74
|
-
|
75
|
-
File.open(REDIS_CNF, 'w') do |file|
|
76
|
-
file.puts "\# This file was auto-generated at #{Time.now}",
|
77
|
-
"\# from (#{erb})",
|
78
|
-
"\#"
|
79
|
-
conf = ERB.new(template).result
|
80
|
-
file << conf
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
Rake::TestTask.new do |t|
|
85
|
-
t.options = "-v" if $VERBOSE
|
86
|
-
t.test_files = FileList["test/*_test.rb"]
|
87
|
-
end
|