chore: tests?

This commit is contained in:
pwgen2155 2024-02-28 17:01:32 +11:00
parent c14bf800d2
commit 69f04e216c
2 changed files with 19 additions and 1 deletions

View file

@ -7,5 +7,5 @@ steps:
image: python:3.11
commands:
- pip install -r requirements.txt
- pytest
- /bin/bash tests.sh

18
tests.sh Normal file
View file

@ -0,0 +1,18 @@
#!/bin/bash
#
DIR=./
mkdir -p "data"
cp setup/dawdle.conf "$DIR/data"
cp setup/events.txt "$DIR/data"
pushd "$DIR/site/"
SECRET_KEY="$(openssl rand -base64 45)"
sed -e "/^SECRET_KEY/ c \\SECRET_KEY = '${SECRET_KEY}'" \
-e "/^ALLOWED_HOSTS/ c \\ALLOWED_HOSTS = ['${HOST}']" \
-e "/^DEBUG/ c \\DEBUG = False" \
setup/project-settings.py \
>project/settings.py
./manage.py migrate --database=default
./manage.py migrate --database=game
./manage.py collectstatic --no-input
cd "$DIR"
"$DIR/dawdle.py" --setup "$DIR/data/dawdle.conf"