Skip to content

Commit

Permalink
Update: 调整测试
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX committed Mar 29, 2024
1 parent 20d4050 commit b18cb36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/actions/ci-prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ runs:
docker compose -f ./.github/docker-compose.yml up -d ${{ inputs.env }} redis-new
docker exec ${{ inputs.env }} php -v
docker exec ${{ inputs.env }} php -m
docker exec ${{ inputs.env }} php --ri redis
docker exec ${{ inputs.env }} php --ri swoole
docker exec ${{ inputs.env }} php -r "echo 'opcache config: '; print_r(opcache_get_status(false));"
docker exec ${{ inputs.env }} composer -V
Expand Down
11 changes: 10 additions & 1 deletion src/Components/redis/tests/Tests/PhpRedisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,18 @@ public function testEvalScriptClass(IRedisHandler $redis): void
#[Depends('testGetDrive')]
public function testEvalScriptReadOnly(IRedisHandler $redis): void
{
if (version_compare($redis->getServerVersion(), '7.0', '<')) {
if (version_compare($redis->getServerVersion(), '7.0', '<'))
{
$this->markTestSkipped(sprintf('Redis version %s does not support read-only script', $redis->getServerVersion()));
}
if (($redis instanceof PhpRedisHandler || $redis instanceof PhpRedisClusterHandler) && version_compare($redis->getClientVersion(), '6.0', '<'))
{
$this->markTestSkipped(sprintf('PhpRedis version %s does not support read-only script', $redis->getClientVersion()));
}
if ($redis instanceof PredisClusterHandler && version_compare($redis->getVersion(), '2.2', '<'))
{
$this->markTestSkipped(sprintf('Predis (Cluster) version %s does not support read-only script', $redis->getClientVersion()));
}

$this->flushLuaScript($redis);

Expand Down

0 comments on commit b18cb36

Please sign in to comment.