Newer
Older
PY_EXE=${PY_EXE:-$(poetry run which python)}
echo "-----------------------------------------------"
echo "Current directory: $(pwd)"
echo "Python executable: ${PY_EXE}"
echo "-----------------------------------------------"
# Testing i18n needs a local_settings file even though the rest of the tests
# don't use it
cp local_settings_example.py local_settings.py
# Make sure i18n literals marked correctly
poetry run python manage.py makemessages
poetry run python manage.py compilemessages
export RELATE_LOCAL_TEST_SETTINGS="local_settings_example.py"
PYTEST_COMMON_FLAGS="--cov-config=setup.cfg --cov-report=xml --cov=. --tb=native"
if [[ "$RL_CI_TEST" = "expensive" ]]; then
poetry run python -m pytest $PYTEST_COMMON_FLAGS --slow
elif [[ "$RL_CI_TEST" = "postgres" ]]; then
export PGPASSWORD=relatepgpass
echo "Preparing database"
echo "import psycopg2.extensions" >> local_settings_example.py
'HOST': 'localhost',
'USER': 'postgres',
'PASSWORD': '${PGPASSWORD}',
'NAME': 'test_relate',
'OPTIONS': {
'isolation_level': psycopg2.extensions.ISOLATION_LEVEL_SERIALIZABLE,
},
},
poetry run python -m pytest $PYTEST_COMMON_FLAGS
poetry run python -m pytest $PYTEST_COMMON_FLAGS