Skip to content

Commit

Permalink
Update: 修复测试
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX committed Feb 17, 2024
1 parent 492fe31 commit 1f411e5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ services:
ports:
- "9092:9092"

redis-node-0:
redis-cluster-node-0:
image: bitnami/redis-cluster:7.2
volumes:
- redis-cluster_data-0:/bitnami/redis/data
environment:
- 'REDIS_PASSWORD=l83aa26'
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'

redis-node-1:
redis-cluster-node-1:
image: bitnami/redis-cluster:7.2
volumes:
- redis-cluster_data-1:/bitnami/redis/data
environment:
- 'REDIS_PASSWORD=l83aa26'
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'

redis-node-2:
redis-cluster-node-2:
image: bitnami/redis-cluster:7.2
volumes:
- redis-cluster_data-2:/bitnami/redis/data
Expand All @@ -129,6 +129,9 @@ services:
- rabbitmq
- kafka1
- postgres
- redis-cluster-node-0
- redis-cluster-node-1
- redis-cluster-node-2
environment:
MYSQL_SERVER_HOST: mysql
REDIS_SERVER_HOST: ${REDIS_SERVER_HOST}
Expand All @@ -153,6 +156,9 @@ services:
- rabbitmq
- kafka1
- postgres
- redis-cluster-node-0
- redis-cluster-node-1
- redis-cluster-node-2
environment:
MYSQL_SERVER_HOST: mysql
REDIS_SERVER_HOST: ${REDIS_SERVER_HOST}
Expand Down
8 changes: 8 additions & 0 deletions src/Components/redis/tests/Tests/PhpRedisClusterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ class PhpRedisClusterTest extends PhpRedisTest
{
public string $driveName = 'test_phpredis_cluster';

public static function setUpBeforeClass(): void
{
if (\PHP_OS_FAMILY === 'Windows')
{
self::markTestSkipped('not support redis cluster');
}
}

public function testGetDrive(): IRedisHandler
{
$redisClient = RedisManager::getInstance($this->driveName);
Expand Down
8 changes: 8 additions & 0 deletions src/Components/redis/tests/Tests/PredisClusterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ class PredisClusterTest extends PhpRedisTest
{
public string $driveName = 'test_predis_cluster';

public static function setUpBeforeClass(): void
{
if (\PHP_OS_FAMILY === 'Windows')
{
self::markTestSkipped('not support redis cluster');
}
}

public function testGetDrive(): IRedisHandler
{
$redisClient = RedisManager::getInstance($this->driveName);
Expand Down
2 changes: 1 addition & 1 deletion src/Components/redis/tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<!-- <env name="XDEBUG_MODE" value="off" force="true"/>-->
<env name="REDIS_SERVER_PASSWORD" value="" force="false"/>
<env name="REDIS_SERVER_CLUSTER_PASSWORD" value="l83aa26" force="false"/>
<env name="REDIS_SERVER_CLUSTER_SEEDS" value="redis-node-0,redis-node-1,redis-node-2" force="false"/>
<env name="REDIS_SERVER_CLUSTER_SEEDS" value="redis-cluster-node-0:6379,redis-cluster-node-1:6379,redis-cluster-node-2:6379" force="false"/>
</php>
</phpunit>

0 comments on commit 1f411e5

Please sign in to comment.