mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-25 11:17:50 +01:00
50b12d9bb7
* set debug, test, and primary_db env variables based on context * remove unnecessary print * also use pytest.ini for some tests run straight from pytest at the CLI
28 lines
789 B
Bash
Executable File
28 lines
789 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
if ! command -v nodemon &> /dev/null
|
|
then
|
|
echo "Please install nodemon (npm install -g nodemon) to automatically run tests."
|
|
exit
|
|
fi
|
|
|
|
|
|
if [ $# -eq 0 ]; then
|
|
echo "Are you sure you want to run all backend tests? You can run specific tests by doing:"
|
|
echo " "
|
|
echo "bin/tests posthog/api/test/test_user.py::TestUserAPI::test_retrieve_current_user"
|
|
echo " "
|
|
read -r -p "Run all tests? [y/N] " response
|
|
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
|
|
then
|
|
echo "OK!"
|
|
else
|
|
exit
|
|
fi
|
|
fi
|
|
|
|
export REDIS_URL='redis:///'
|
|
psql posthog -c "drop database if exists test_posthog"
|
|
nodemon -w ./posthog -w ./ee --ext py --exec "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES pytest --reuse-db -s $* --snapshot-update; mypy posthog ee"
|