fix(tests): fixed testing DB deployment v4

This commit is contained in:
ribardej
2025-10-29 14:20:20 +01:00
parent 542b05d541
commit 55f8e38376
3 changed files with 12 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ permissions:
on:
# Run on every push to the 'main' branch
push:
branches: [ "main", "33-frontend-looks-like-logged-in-even-after-token-expires" ]
branches: [ "main" ]
# Also run on every pull request that targets the 'main' branch
pull_request:
branches: [ "main" ]
@@ -30,9 +30,9 @@ jobs:
MARIADB_DATABASE: group_project # Using the DB name your app expects
MARIADB_USER: appuser
MARIADB_PASSWORD: apppass
# ADD THIS BLOCK BACK IN
# This forces the job to wait until the DB is
# actually responding before continuing.
ports:
- 3306:3306
# Healthcheck ensures the job only starts when DB is ready
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -u root -prootpw --silent"
--health-interval=5s
@@ -40,9 +40,9 @@ jobs:
--health-retries=20
# This is the job-level 'env' block
# It will be used by the 'alembic' step
# It will be used by all steps (alembic, pytest, etc.)
env:
MARIADB_HOST: mariadb # Use the service label as the host
MARIADB_HOST: 127.0.0.1
MARIADB_PORT: "3306"
MARIADB_DB: group_project
MARIADB_USER: appuser
@@ -73,7 +73,8 @@ jobs:
# file that your pytest setup might be loading
- name: Run tests with pytest
env:
MARIADB_HOST: mariadb
MARIADB_HOST: 127.0.0.1
MARIADB_PORT: "3306"
MARIADB_DB: group_project
MARIADB_USER: appuser
MARIADB_PASSWORD: apppass