Skip to content

Commit 35aef7c

Browse files
committed
Fix hostnames for CI services.
1 parent 7bb33b0 commit 35aef7c

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,7 @@ jobs:
8888
version: composer
8989
configuration: phpunit.xml
9090
args: '--testdox'
91-
91+
env:
92+
SITES_DB_HOSTNAME: localhost
93+
SITES_POSTGRES_HOSTNAME: localhost
94+
SITES_REDIS_HOSTNAME: localhost

tests/CacheRedisTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public function setUp(): void
2020

2121
try {
2222
$cache = new PdbRedisCache([
23-
'host' => Env::isDocker() ? 'tcp://redis:6379' : 'localhost',
23+
'host' => getenv('SITES_REDIS_HOSTNAME') ?: 'localhost',
2424
'prefix' => 'pdb:',
2525
]);
2626
}
27-
catch (Exception $e) {
27+
catch (\Exception $e) {
2828
$this->markTestSkipped('Redis not available: ' . $e->getMessage());
2929
}
3030

tests/PdbPgsqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function setUp(): void
1515
{
1616
$this->pdb = Pdb::create([
1717
'type' => PdbConfig::TYPE_PGSQL,
18-
'host' => 'postgres',
18+
'host' => getenv('SITES_POSTGRES_HOSTNAME') ?: 'postgres',
1919
'user' => 'postgres',
2020
'pass' => 'password',
2121
'database' => 'kbpdb',

tests/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
return [
99
'type' => 'mysql',
10-
'host' => '127.0.0.1',
10+
'host' => getenv('SITES_DB_HOSTNAME') ?: '127.0.0.1',
1111
'user' => 'kbpdb',
1212
'pass' => 'password',
1313
'database' => 'kbpdb',

0 commit comments

Comments
 (0)