-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwrapper.sh
executable file
·37 lines (32 loc) · 964 Bytes
/
wrapper.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
#!/bin/bash
test_type=$1
datadir=$2
break_on_failure=$3
if [ "${test_type}" == "api" ]; then
suite=`echo $4 | rev |cut -d "/" -f1 | rev | cut -d "." -f1`
if [ "${break_on_failure}" == "1" ]; then
ipdb="--pdb --pdbcls=IPython.terminal.debugger:Pdb"
else
ipdb=""
fi
cmd="/usr/local/bin/pytest $ipdb /mist.tests/$4"
else
suite=$4
export BEHAVE_DEBUG_ON_ERROR=$3
export DATADIR=$2
cmd="/usr/local/bin/behave -k --no-capture --no-capture-stderr --stop --tags=$4 misttests/integration/gui/v1/pr/features/"
fi
logfile=$datadir/${test_type}-${suite}.txt
script -e -c "$cmd" $logfile
ret=${PIPESTATUS[0]}
if [ $ret -ne 0 ]; then
echo $cmd failed with exit code $ret
echo logs available at $logfile
# read -p "Press enter to continue" input
else
# echo $cmd succeeded with exit code $ret
# echo logs available at $logfile
# read -p "Press enter to continue" input
rm $logfile
fi
exit $ret