-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.sh
33 lines (32 loc) · 1.03 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -e
PREFIX="$(dirname "$(readlink -f "$0")")"
LOGFILE=$PREFIX/logs/run-tests-$(date "+%d").txt
TENPYDIR="$PREFIX/tenpy"
TENPYDIRCOMPILED="$PREFIX/tenpy_compiled"
{
source "$PREFIX/tenpybot_env/bin/activate"
cd "$TENPYDIR"
echo "in $TENPYDIR"
export PYTHONPATH="$TENPYDIR"
echo -n "check git status before pull: " && test -z "$(git status -s)" && echo "ok"
git pull
echo -n "check git status after pull: " && test -z "$(git status -s)" && echo "ok"
cd tests
pytest
echo -n "check git status after tests: " && test -z "$(git status -s)" && echo "ok"
if [ -d "$TENPYDIRCOMPILED" ]
then
echo "in $TENPYDIRCOMPILED"
cd "$TENPYDIRCOMPILED"
export PYTHONPATH="$TENPYDIRCOMPILED"
echo -n "check git status before pull: " && test -z "$(git status -s)" && echo "ok"
git pull
echo "compile"
bash ./compile.sh
echo -n "check git status after pull: " && test -z "$(git status -s)" && echo "ok"
cd tests
pytest
echo -n "check git status after tests: " && test -z "$(git status -s)" && echo "ok"
fi
} &> "$LOGFILE"