simple-login/scripts/run-test.sh

20 lines
475 B
Bash
Raw Normal View History

2021-08-20 10:00:45 +00:00
# Run tests
2022-05-01 15:38:14 +00:00
# Delete the test DB if it isn't properly removed
docker rm -f sl-test-db
2022-05-01 15:38:14 +00:00
# Create a test DB
2021-08-20 10:00:45 +00: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 15:38:14 +00:00
# the time for the test DB container to start
2022-02-03 21:11:42 +00:00
sleep 3
2022-05-01 15:38:14 +00:00
# migrate the DB to the latest version
CONFIG=tests/test.env poetry run alembic upgrade head
# run test
2022-05-20 12:45:33 +00:00
poetry run pytest -c pytest.ci.ini
2021-08-20 10:00:45 +00:00
2022-05-01 15:38:14 +00:00
# Delete the test DB
2022-02-03 21:08:38 +00:00
docker rm -f sl-test-db