forked from sensu-plugins/sensu-plugin-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests
executable file
·61 lines (49 loc) · 1.03 KB
/
run_tests
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
#!/bin/sh
EXIT=0
rc() {
if [ "$?" -ne 0 ]; then
EXIT=1
fi
}
[ -f /docker ] && cd sensu-plugin-python
run_pycodestyle() {
echo '
PYCODESTYLE -------------------------------------------------------------------'
pycodestyle sensu_plugin
rc
}
run_pylint() {
echo '
PYLINT ------------------------------------------------------------------------'
pylint --rcfile=pylint.rc sensu_plugin
rc
}
run_nosetests() {
echo '
NOSETESTS ---------------------------------------------------------------------'
nosetests --with-coverage --cover-package=sensu_plugin \
--cover-min-percentage=80 --cover-tests --cover-erase \
--cover-html --cover-html-dir=./report -w sensu_plugin/tests \
--exe
# --exe means to run all executable tests
rc
}
case $1 in
pycodestyle|style)
run_pycodestyle
;;
pylint|lint)
run_pylint
;;
nose|nosetests)
run_nosetests
;;
*)
run_pycodestyle
run_pylint
run_nosetests
;;
esac
echo
echo "Exiting with code $EXIT"
exit $EXIT