Skip to content

[Task] Add a second standalone Valkey server instance to the CI test infrastructure #275

Description

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:

  1. Single-key migrate success (standalone) — migrate key, verify deleted from source, verify exists on destination
  2. Single-key migrate success (cluster) — same as above but on cluster client
  3. Multi-key migrate success (standalone) — migrate multiple keys, verify all moved
  4. Migrate with COPY flag success — migrate key, verify it still exists on source AND exists on destination
  5. Migrate with REPLACE flag success — set a key on destination first, migrate from source, verify destination value is overwritten
  6. Migrate with AUTH success — destination requires password, migrate with credentials
  7. 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

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions