Summary
Add a second standalone Valkey server instance to the CI test infrastructure to enable full integration testing of the MIGRATE command with actual key transfers.
Context
The MIGRATE command (#275) is implemented and tested for error paths (invalid host, NOKEY for non-existent keys, COPY/REPLACE options). However, testing successful key migration requires a second Valkey
instance to migrate to, which our CI currently doesn't provide.
Python and C# GLIDE clients have this infrastructure (Python uses a second_server fixture, C# uses TestClients), enabling tests that verify:
- Key is transferred to the destination
- Key is deleted from the source (unless COPY is set)
- Multi-key migration works end-to-end
Test Scenarios to Add
Tests requiring a second Valkey server instance for migrate command:
- Single-key migrate success (standalone) — migrate key, verify deleted from source, verify exists on destination
- Single-key migrate success (cluster) — same as above but on cluster client
- Multi-key migrate success (standalone) — migrate multiple keys, verify all moved
- Migrate with COPY flag success — migrate key, verify it still exists on source AND exists on destination
- Migrate with REPLACE flag success — set a key on destination first, migrate from source, verify destination value is overwritten
- Migrate with AUTH success — destination requires password, migrate with credentials
- Migrate with AUTH2 success — destination requires username+password, migrate with AUTH2 credentials
php
// Single-key successful migration
$this->valkey_glide->set('migrate_key', 'value');
$result = $this->valkey_glide->migrate('localhost', 6389, 'migrate_key', 0, 5000);
$this->assertTrue($result);
$this->assertFalse($this->valkey_glide->exists('migrate_key'));
// Verify on destination: key exists with correct value
// With COPY flag
$result = $this->valkey_glide->migrate('localhost', 6389, 'key', 0, 5000, true);
$this->assertTrue($result);
$this->assertTrue($this->valkey_glide->exists('key')); // Still exists on source
Related
Summary
Add a second standalone Valkey server instance to the CI test infrastructure to enable full integration testing of the MIGRATE command with actual key transfers.
Context
The MIGRATE command (#275) is implemented and tested for error paths (invalid host, NOKEY for non-existent keys, COPY/REPLACE options). However, testing successful key migration requires a second Valkey
instance to migrate to, which our CI currently doesn't provide.
Python and C# GLIDE clients have this infrastructure (Python uses a second_server fixture, C# uses TestClients), enabling tests that verify:
Test Scenarios to Add
Tests requiring a second Valkey server instance for migrate command:
php
// Single-key successful migration
$this->valkey_glide->set('migrate_key', 'value');
$result = $this->valkey_glide->migrate('localhost', 6389, 'migrate_key', 0, 5000);
$this->assertTrue($result);
$this->assertFalse($this->valkey_glide->exists('migrate_key'));
// Verify on destination: key exists with correct value
// With COPY flag
$result = $this->valkey_glide->migrate('localhost', 6389, 'key', 0, 5000, true);
$this->assertTrue($result);
$this->assertTrue($this->valkey_glide->exists('key')); // Still exists on source
Related