From 702e92756283e512eb4dff33ede469122a7c942e Mon Sep 17 00:00:00 2001 From: Konstantinos Togias Date: Sat, 23 Jul 2022 21:06:37 +0300 Subject: [PATCH] Fixed ping context for test env --- dev/tests/features/bootstrap/PingContext.php | 5 ++++- ops/envs/test/comp/docker-compose.yaml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dev/tests/features/bootstrap/PingContext.php b/dev/tests/features/bootstrap/PingContext.php index 4cde3ec..448fd1f 100644 --- a/dev/tests/features/bootstrap/PingContext.php +++ b/dev/tests/features/bootstrap/PingContext.php @@ -15,6 +15,8 @@ class PingContext implements Context { protected int $port; + protected string $host; + protected Curl $curl; /** @@ -34,6 +36,7 @@ public function __construct() public function theServicePortIsDefined() { $this->port = getenv('HTTP_PORT'); + $this->host = getenv('HTTP_HOST')?:'localhost'; } /** @@ -42,7 +45,7 @@ public function theServicePortIsDefined() public function iDoHttpGet() { $this->curl = new Curl(); - $this->curl->get('http://localhost:'.$this->port); + $this->curl->get('http://'.$this->host.':'.$this->port); } /** diff --git a/ops/envs/test/comp/docker-compose.yaml b/ops/envs/test/comp/docker-compose.yaml index 13044a6..04f8743 100644 --- a/ops/envs/test/comp/docker-compose.yaml +++ b/ops/envs/test/comp/docker-compose.yaml @@ -69,6 +69,7 @@ services: HOST_GID: ${HOST_UID} HOST_UID: ${HOST_UID} HTTP_PORT: ${HTTP_PORT} + HTTP_HOST: event-dispatcher TZ: ${TIME_ZONE} MESSAGE_BROKER_HOST: ${MESSAGE_BROKER_HOST} MESSAGE_BROKER_PORT: ${MESSAGE_BROKER_PORT}