mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
fix(tests): fixed testing DB deployment v4
This commit is contained in:
15
.github/workflows/run-tests.yml
vendored
15
.github/workflows/run-tests.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user