2021-08-20 12:00:45 +02:00
|
|
|
# Run tests
|
|
|
|
|
2022-05-01 17:38:14 +02:00
|
|
|
# Delete the test DB if it isn't properly removed
|
2022-01-24 18:05:06 +01:00
|
|
|
docker rm -f sl-test-db
|
|
|
|
|
2022-05-01 17:38:14 +02:00
|
|
|
# Create a test DB
|
2021-08-20 12:00:45 +02:00
|
|
|
docker run -d --name sl-test-db -e POSTGRES_PASSWORD=test -e POSTGRES_USER=test -e POSTGRES_DB=test -p 15432:5432 postgres:13
|
|
|
|
|
2022-05-01 17:38:14 +02:00
|
|
|
# the time for the test DB container to start
|
2022-02-03 22:11:42 +01:00
|
|
|
sleep 3
|
2022-01-24 18:05:06 +01:00
|
|
|
|
2022-05-01 17:38:14 +02:00
|
|
|
# migrate the DB to the latest version
|
|
|
|
CONFIG=tests/test.env poetry run alembic upgrade head
|
|
|
|
|
|
|
|
# run test
|
2021-08-20 12:00:45 +02:00
|
|
|
poetry run pytest
|
|
|
|
|
2022-05-01 17:38:14 +02:00
|
|
|
# Delete the test DB
|
2022-02-03 22:08:38 +01:00
|
|
|
docker rm -f sl-test-db
|