This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
rotini/backend/script/test

19 lines
557 B
Text
Raw Normal View History

#!/bin/bash
TEST_DB_CONTAINER=rotini-test-ephemeral
docker run \
--name $TEST_DB_CONTAINER \
-e POSTGRES_PASSWORD=test \
-p 5431:5432 \
-d \
postgres:15.4
sleep 2
ROTINI_TEST=1 PYTHONPATH=rotini .venv/bin/python rotini/migrations/migrate.py up || echo "Migrations failed."
ROTINI_TEST=1 .venv/bin/pytest . -vv -s || echo "Test run failed."
docker stop $TEST_DB_CONTAINER > /dev/null || echo "Failed to stop test database container."
docker remove $TEST_DB_CONTAINER > /dev/null || echo "Failed to clean up test database container."