fix(tests): fixed test runtime errors regarding database connection

This commit is contained in:
ribardej
2025-11-11 15:27:03 +01:00
parent 67b44539f2
commit 3d26ed6a62
2 changed files with 10 additions and 10 deletions

View File

@@ -33,6 +33,7 @@ jobs:
MARIADB_PASSWORD: apppass
# Ensure the application uses MariaDB (async) during tests
DATABASE_URL: mysql+asyncmy://appuser:apppass@127.0.0.1:3306/group_project
DISABLE_METRICS: "1"
steps:
- name: Check out repository code

View File

@@ -59,11 +59,10 @@ fastApi.add_middleware(
allow_headers=["*"],
)
if os.getenv("DISABLE_METRICS") != "1":
prometheus = Instrumentator().instrument(fastApi)
# Register custom metrics
prometheus.add(number_of_users()).add(number_of_transactions())
prometheus.expose(
fastApi,
endpoint="/metrics",