Commit 6396496
authored
Replace Docker cluster with cluster_manager.py (#108)
* feat(ruby): replace Docker cluster with cluster_manager.py
- Add Valkey::TestCluster class wrapping cluster_manager.py invocation
- Update Helper::Cluster to use TestCluster for dynamic cluster management
- Update Helper::Client with standalone server support via TestCluster
- Update CI workflow to use Python 3.11 + native Valkey installation
- Remove grokzen/redis-cluster Docker dependency
- Add rantly gem for property-based testing
- Fix hardcoded port 7000 reference in connection_options.rb
This aligns the Ruby client's cluster testing infrastructure with other
GLIDE clients (Python, Java, Go) by using the shared cluster_manager.py
script from valkey-glide/utils/.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ci): build Valkey from source instead of using packages.valkey.io
packages.valkey.io DNS resolution was failing in GitHub Actions.
Build Valkey 8.0.0 from source with TLS support, matching the
approach used by valkey-glide's install-engine action.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix: resolve RuboCop offenses in test cluster infrastructure
- Use ENV.fetch with nil default instead of ENV[] (FetchEnvVar)
- Use modifier unless for single-line conditional (IfUnlessModifier)
- Add test_cluster.rb to Metrics/ClassLength and MethodLength exclusions
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* refactor: rename test:valkey to test:standalone, run both by default
- Rename test/valkey/ directory to test/standalone/
- Update Rakefile: test:valkey → test:standalone
- Default 'test' task now runs both test:standalone and test:cluster
- Update CI workflow to use test:standalone
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* refactor(ruby): unify test structure with shared ValkeyTests modules
- Rename test/standalone/ to test/valkey/ for shared modules
- Convert test classes to ValkeyTests::* modules (like Lint::*)
- Create new test/standalone/ with test classes that include modules
- Update test/cluster/cluster_commands_test.rb to include ValkeyTests modules
- Update test_helper.rb to load valkey shared test modules
- Fix assert_not_nil -> refute_nil for Minitest compatibility
Signed-off-by: Alex Rehnby-Martin <alexrema@amazon.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): separate test classes for modules with custom setup methods
- Split Lint modules with setup methods (GeoCommands, JsonCommands,
ModuleCommands, VectorSearchCommands) into their own test classes
- Fix test isolation issue where GeoCommands.setup created 'Sicily' key
that leaked into other tests like test_del
- Add ensure_otel_initialized to OpenTelemetry module setup to handle
random test ordering
- Add skip for test_randomkey in cluster mode (requires isolated db)
Fixes standalone test failures caused by setup method conflicts when
multiple Lint modules were combined into a single test class.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): add cluster-mode skips for cross-slot operations
- Skip cross-slot operations (smove, sinter, sdiff, zunion, zinter, etc.) in cluster mode
- Skip rename/renamenx in cluster mode (different hash slots)
- Skip lmove when using different keys across hash slots
- Skip EXEC/DISCARD without MULTI in cluster mode
- Fix function tests to clean up libraries before loading (rolib, policylib)
- Relax OpenTelemetry span count assertions to handle test ordering
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* chore: remove spec files and notes from git tracking
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* refactor(ruby): restore _test suffix to test/valkey module files
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* chore(ruby): exclude test/valkey and test/lint from lost_tests check
These directories contain reusable test modules (not standalone test files)
that are included by test classes in test/standalone/ and test/cluster/.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): add cluster-mode skips for MULTI/EXEC and cross-slot tests
- Skip all MULTI/EXEC transaction tests in cluster mode (connection routing issues)
- Skip geosearchstore test (source/destination keys may be on different slots)
- Skip sorting tests with GET/STORE (cross-slot operations)
- Skip eval/evalsha tests with random keys (cross-slot operations)
- Skip large_parameter_arrays test (50 keys on different slots)
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): add flush delay in OpenTelemetry test setup
Wait 200ms before cleaning test files to allow any buffered spans
from previous tests to flush. This fixes flaky span count assertions
caused by async span flushing with 100ms flush interval.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): add cluster-mode skips for CrossSlot and destructive tests
- Skip test_del, test_del_with_array_argument (untagged keys)
- Skip test_scan (may not see all keys in cluster mode)
- Skip test_select_database (behavior varies in cluster)
- Skip test_memory_malloc_stats (returns multi-node Array)
- Skip test_pfmerge (untagged keys foo/bar/res)
- Skip test_script_execution_consistency, test_parameter_round_trip_preservation
(random keys may be on different slots)
- Skip destructive cluster slot management tests (addslotsrange, delslotsrange,
addslots, delslots, setslot) to prevent cluster instability
- Fix statistics tests to use _new_client helper instead of hard-coded port 7000
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* style(ruby): fix rubocop offenses in test files
- Convert rescue modifier to begin/rescue blocks in function_commands.rb
- Fix comment annotation format in commands_test.rb
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): use _new_client helper in test_client_kill tests
The tests were using Valkey.new which defaults to 127.0.0.1:6379,
but in cluster mode there's no standalone server at that address.
Use _new_client helper to get a properly configured client.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* fix(ruby): skip CLIENT KILL tests in cluster mode
CLIENT KILL by address doesn't work reliably in cluster mode because
the command may be routed to a different node than where the client
is connected, resulting in 'No such client' errors.
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* Address PR feedback
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
* chore(ruby): address PR review feedback
- Remove unused rantly gem from Gemfile
- Remove unused start_server/stop_server methods from Helper::Client
- Move test_cluster.rb from lib/ to test/support/ (not shipped in gem)
- Update docs to use test:standalone instead of test:valkey
- Update cd.yml to use rake test:standalone
- Update .rubocop.yml to remove stale exclusions
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
---------
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alexrema@amazon.com>1 parent 1465b38 commit 6396496
56 files changed
Lines changed: 2235 additions & 1974 deletions
File tree
- .github/workflows
- test
- cluster
- lint
- standalone
- support
- helper
- valkey
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | 251 | | |
268 | 252 | | |
269 | 253 | | |
270 | 254 | | |
271 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | 284 | | |
337 | 285 | | |
338 | 286 | | |
339 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
129 | | - | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
18 | 75 | | |
19 | 76 | | |
20 | | - | |
| 77 | + | |
| 78 | + | |
0 commit comments