Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Run tests using Testcontainers #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ jobs:
tests:
needs: [build]
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10.5
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

name: Python ${{ matrix.python-version }}
strategy:
matrix:
Expand Down Expand Up @@ -57,13 +48,6 @@ jobs:
run: |
poetry install --only dev --no-root

- name: Set MySQL mode
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
mysql --host $DB_HOST --port $DB_PORT -uroot -proot -e "SET GLOBAL sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'";

- name: Test package backend
run: |
PACKAGE=`(cd dist && ls *whl)` && echo $PACKAGE
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ on:
jobs:

backend:

services:
mysql:
image: mariadb:10.5
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
matrix:
python-version: [3.11, 3.12]
Expand All @@ -44,12 +34,6 @@ jobs:
run: |
poetry install -vvv
poetry run pip install -r requirements_dev.txt
- name: Set MySQL mode
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
mysql --host $DB_HOST --port $DB_PORT -uroot -proot -e "SET GLOBAL sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'";
- name: Lint with flake8
run: |
poetry run flake8
Expand Down
4 changes: 4 additions & 0 deletions config/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
}
}

TEST_DATABASE_IMAGE = "mariadb:11.4"

TEST_RUNNER = 'tests.runners.TestContainersRunner'


# Configuration to pretend there is a Redis service
# available. We need to set up the connection before
Expand Down
Loading
Loading