From 962a0d8d668e441ea4a5af0212aa9af9981846be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@ericsson.com>
Date: Mon, 2 Sep 2024 09:35:19 +0200
Subject: [PATCH] fail faster

---
 .gitlab-ci.yml           | 8 ++++++--
 stress_tests/settings.py | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9a15077..ca75d28 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,8 @@ stress_test:
   script:
     - coverage run --append -m stress_tests
     - COOLAMQP_FORCE_SELECT_LISTENER=1 coverage run --append -m stress_tests
+  variables:
+    AMQP_HOST: "rabbitmq"
   after_script:
     - mv .coverage .coverage.stress
   artifacts:
@@ -21,18 +23,20 @@ stress_test:
 
 unittest:
   stage: test
-  image: python:3.11
+  image: python:3.11      # Default image might have already CoolAMQP installed
   services:
     - name: rabbitmq:3-management
       alias: rabbitmq
   before_script:
     - python setup.py install
-    - pip install --break-system-packages nose2 coverage
+    - pip install --break-system-packages nose2 coverage requests yapf
     - coverage run --append -m compile_definitions
   script:
     - coverage run --append -m nose2 -F -vv
   after_script:
     - mv .coverage .coverage.units
+  variables:
+    AMQP_HOST: "rabbitmq"
   artifacts:
     paths:
       - ".coverage.units"
diff --git a/stress_tests/settings.py b/stress_tests/settings.py
index 8e2badf..57424f4 100644
--- a/stress_tests/settings.py
+++ b/stress_tests/settings.py
@@ -6,7 +6,7 @@ from coolamqp.objects import NodeDefinition
 
 logger = logging.getLogger(__name__)
 
-NODE = NodeDefinition(os.environ.get('AMQP_HOST', 'rabbitmq'), 'guest', 'guest', heartbeat=20)
+NODE = NodeDefinition(os.environ.get('AMQP_HOST', '127.0.0.1'), 'guest', 'guest', heartbeat=20)
 logging.basicConfig(level=logging.DEBUG)
 
 
-- 
GitLab