-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.sh
executable file
·63 lines (56 loc) · 1.24 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
source activate # ensure tests are done in virtualenv
export ENV=development # force to development for local testing
test_args="" # init var
markers="" # init var
# All modules in src/endpoints need to be specified if you want to have
# separated test markers for each endpoint
modules=(
auth
general
logs
users
)
# check for args
for arg in "$@"
do
if [[ "$arg" == *"nodb"* ]]; then
DO_NODB=1
fi
if [[ "$arg" == *"cov"* ]]; then
DO_COVERAGE=1
fi
if [[ "$arg" == *"lint"* ]]; then
DO_LINT=1
fi
if [[ "$arg" == *"full"* ]]; then
DO_FULL=1
fi
for i in "${modules[@]}"; do
if [[ "$arg" == *"$i"* ]]; then
eval "do_$i=1"
fi
done
done
# add args
if [ -n "${DO_COVERAGE+1}" ]; then
test_args+=" --cov"
fi
if [ -n "${DO_LINT+1}" ]; then
test_args+=" --flake8 --cache-clear"
fi
if [ -n "${DO_FULL+1}" ]; then
test_args+=" -rP"
fi
if [ -n "${DO_NODB+1}" ]; then
echo $DO_NODB
test_args+=" --nodb"
fi
for i in "${modules[@]}"; do
marker="do_${i}"
if [ -n "${!marker+1}" ]; then
markers+=" ${i}"
fi
done
test_args+=" -W ignore::PendingDeprecationWarning"
markers=`echo $markers|sed 's/\ /\ or\ /g'`
py.test -v ${test_args} -m "${markers}" --color=yes