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 28c95b1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install requirements"
run: sudo apt-get update && sudo apt-get install --no-install-recommends redis-server ruby-foreman
- name: "Install redis server"
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: "7.x"
auto-start: 'false'
- name: "Install cli for Procfile"
run: sudo apt-get update && sudo apt-get install --no-install-recommends ruby-foreman
- name: "Start background services"
run: sudo systemctl stop redis-server && foreman start &
- name: "Install PHP"
Expand All @@ -47,7 +52,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
4 changes: 2 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
redis: sh -c 'cp .github/workflows/redis-configs/redis.conf /tmp/ && redis-server /tmp/redis.conf --port 6379'
redis: sh -c 'cp .github/workflows/redis-configs/redis.conf /tmp/ && redis-server /tmp/redis.conf --port 6379 > /tmp/redis-log'
redis-acl: sh -c 'cp .github/workflows/redis-configs/redis-acl.conf /tmp/ && redis-server /tmp/redis-acl.conf --port 7099'
redis-sentinel: sh -c 'cp .github/workflows/redis-configs/redis-sentinel.conf /tmp/ && redis-server /tmp/redis-sentinel.conf --sentinel'
redis-sentinel: sh -c 'cp .github/workflows/redis-configs/redis-sentinel.conf /tmp/ && redis-server /tmp/redis-sentinel.conf --sentinel >/tmp/sentinel-log'
redis-node1: sh -c 'cp -R .github/workflows/redis-configs/redis-node1 /tmp/ && cd /tmp/redis-node1 && redis-server redis.conf --port 7079'
redis-node2: sh -c 'cp -R .github/workflows/redis-configs/redis-node2 /tmp/ && cd /tmp/redis-node2 && redis-server redis.conf --port 7080'
redis-node3: sh -c 'cp -R .github/workflows/redis-configs/redis-node3 /tmp/ && cd /tmp/redis-node3 && redis-server redis.conf --port 7081'
Expand Down
2 changes: 2 additions & 0 deletions src/Factory/PhpredisClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ private function createClientFromSentinel(string $class, array $dsns, string $al

$address = $sentinel->getMasterAddrByName($masterName);
} catch (RedisException | RelayException $e) {
var_dump(file_get_contents('/tmp/redis-log'));

Check failure on line 149 in src/Factory/PhpredisClientFactory.php

View workflow job for this annotation

GitHub Actions / Static Analysis with Psalm

ForbiddenCode

src/Factory/PhpredisClientFactory.php:149:17: ForbiddenCode: Unsafe var_dump (see https://psalm.dev/002)

Check failure on line 149 in src/Factory/PhpredisClientFactory.php

View workflow job for this annotation

GitHub Actions / Coding Standards

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

Check failure on line 149 in src/Factory/PhpredisClientFactory.php

View workflow job for this annotation

GitHub Actions / Coding Standards

Function file_get_contents() should not be referenced via a fallback global name, but via a use statement.
var_dump(file_get_contents('/tmp/sentinel-log'));

Check failure on line 150 in src/Factory/PhpredisClientFactory.php

View workflow job for this annotation

GitHub Actions / Static Analysis with Psalm

ForbiddenCode

src/Factory/PhpredisClientFactory.php:150:17: ForbiddenCode: Unsafe var_dump (see https://psalm.dev/002)

Check failure on line 150 in src/Factory/PhpredisClientFactory.php

View workflow job for this annotation

GitHub Actions / Coding Standards

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

Check failure on line 150 in src/Factory/PhpredisClientFactory.php

View workflow job for this annotation

GitHub Actions / Coding Standards

Function file_get_contents() should not be referenced via a fallback global name, but via a use statement.
continue;
}

Expand Down
5 changes: 4 additions & 1 deletion tests/Factory/PhpredisClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public function testCreateSentinelConfig(
?string $sentinelUser,
?string $sentinelPassword
): void {
if (!@fsockopen('127.0.0.1', 26379)) {
$this->markTestSkipped(sprintf('The %s requires a redis sentinel instance', self::class));
}

$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 +133,6 @@ public function testCreateSentinelConfig(
$client = $factory->create(
$sentinelClass,
[

Check failure on line 135 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 28c95b1

Please sign in to comment.