Added vector sets commands to ClusterStrategy (#1710)

This commit is contained in:
Róbert Kelčák
2026-07-23 08:47:49 +02:00
committed by GitHub
parent c9494ab124
commit bb5ca97854
4 changed files with 81 additions and 0 deletions
@@ -341,6 +341,25 @@ class RedisStrategyTest extends PredisTestCase
}
}
/**
* @group disconnected
*/
public function testKeysForVectorSetCommands(): void
{
$strategy = $this->getClusterStrategy();
$commands = $this->getCommandFactory();
$arguments = [
'VADD' => ['key', [1.0, 2.0], 'element'],
'VSIM' => ['key', [1.0, 2.0]],
];
foreach ($this->getExpectedCommands('keys-vector') as $commandID) {
$command = $commands->create($commandID, $arguments[$commandID]);
$this->assertSame($strategy->getSlotByKey('key'), $strategy->getSlot($command), $commandID);
}
}
/**
* @group disconnected
*/
@@ -687,6 +706,20 @@ class RedisStrategyTest extends PredisTestCase
'XSETID' => 'keys-first',
'XTRIM' => 'keys-first',
/* commands operating on vector sets */
'VADD' => 'keys-vector',
'VCARD' => 'keys-first',
'VDIM' => 'keys-first',
'VEMB' => 'keys-first',
'VGETATTR' => 'keys-first',
'VINFO' => 'keys-first',
'VLINKS' => 'keys-first',
'VRANDMEMBER' => 'keys-first',
'VRANGE' => 'keys-first',
'VREM' => 'keys-first',
'VSETATTR' => 'keys-first',
'VSIM' => 'keys-vector',
/* commands operating on time series */
'TS.READ' => 'keys-first',