-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.sh
executable file
·31 lines (22 loc) · 962 Bytes
/
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
#!/bin/bash
set -e
# Disabling GPU
export CUDA_VISIBLE_DEVICES=-1
# launching mongodb
if [ "$(netstat -tulpn|grep 27017|wc -l)" == "0" ]
then
echo "Starting mongo"
sudo service mongodb start
fi
# script directory
# https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MODULE_PATH=$(python3 -c "import sparse_causal_model_learner_rl; print(sparse_causal_model_learner_rl.__path__[0])")
echo "Running tests..."
python3 -m pytest causal_util sparse_causal_model_learner_rl vectorincrement keychest encoder gin_tune
rm -rf $DIR/results/test_ve5
echo "Running training with gin/sacred/tune"
python3 -m sparse_causal_model_learner_rl.learner --config $MODULE_PATH/configs/test.gin --config $MODULE_PATH/../vectorincrement/config/ve5.gin --nofail
rm -rf $DIR/results/test_ve5
# final message
echo "All tests PASSED!"