Skip to content

Commit

Permalink
ci debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed Sep 6, 2024
1 parent e5f5a90 commit 1e34291
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install requirements"
Expand All @@ -47,7 +47,7 @@ jobs:
tools: "flex"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"

Expand Down
16 changes: 6 additions & 10 deletions src/Factory/PhpredisClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,14 @@ private function createClientFromSentinel(string $class, array $dsns, string $al
'readTimeout' => $readTimeout,
'auth' => [$parameters['sentinel_username'], $parameters['sentinel_password']],
];
try {
if ($isRelay || version_compare(phpversion('redis'), '6.0', '<')) {
$sentinel = new $sentinelClass(...array_values($args));
} else {
$sentinel = new $sentinelClass($args);
}

$address = $sentinel->getMasterAddrByName($masterName);
} catch (RedisException | RelayException $e) {
continue;
if ($isRelay || version_compare(phpversion('redis'), '6.0', '<')) {
$sentinel = new $sentinelClass(...array_values($args));
} else {
$sentinel = new $sentinelClass($args);
}

$address = $sentinel->getMasterAddrByName($masterName);

if (!$address) {
continue;
}
Expand Down
6 changes: 5 additions & 1 deletion tests/Factory/PhpredisClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ public function testCreateSentinelConfig(
?string $sentinelUser,
?string $sentinelPassword
): void {
if (!@fsockopen('127.0.0.1', 26379)) {

Check failure on line 121 in tests/Factory/PhpredisClientFactoryTest.php

View workflow job for this annotation

GitHub Actions / Coding Standards

Expected 1 line after "if", found 0.
$this->markTestSkipped(sprintf('The %s requires a redis sentinel instance', self::class));
}
sleep(5);

Check failure on line 124 in tests/Factory/PhpredisClientFactoryTest.php

View workflow job for this annotation

GitHub Actions / Coding Standards

Function sleep() should not be referenced via a fallback global name, but via a use statement.

$this->logger->method('debug')->with(...$this->withConsecutive(
[$this->stringContains('Executing command "CONNECT 127.0.0.1 6379 5 <null>')],
['Executing command "AUTH sncredis"'],
Expand All @@ -129,7 +134,6 @@ public function testCreateSentinelConfig(
$client = $factory->create(
$sentinelClass,
[

Check failure on line 136 in tests/Factory/PhpredisClientFactoryTest.php

View workflow job for this annotation

GitHub Actions / Coding Standards

Multi-line array contains a single value; use single-line array instead
'redis://undefined@localhost:55555', // unreachable instance
'redis://sncredis@localhost:26379',
],
[
Expand Down

0 comments on commit 1e34291

Please sign in to comment.