forked from Alignak-monitoring-contrib/alignak-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
code_test.sh
83 lines (78 loc) · 2.41 KB
/
code_test.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, frederic.mohier@gmail.com
#
# This file is part of (WebUI).
#
# (WebUI) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# (WebUI) is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with (WebUI). If not, see <http://www.gnu.org/licenses/>.
# echo 'Build Sphinx API doc'
# cd docs
# sphinx-apidoc -f -T -d 2 -M -o source/dev/ ../alignak_webui
# make html
# cd ..
test=1
while [ "$1" != "" ]; do
case $1 in
-t | --test ) test=
;;
esac
shift
done
if [ "$test" = "1" ]; then
echo "Run tests"
else
echo "Do not run tests"
fi
echo 'pep8 ...'
pep8 --max-line-length=100 --exclude='*.pyc, *.cfg, *.log, *.log.*' --ignore='E402' alignak_webui/*
if [ $? -ne 0 ]; then
echo "PEP8 not compliant"
exit
fi
echo 'pylint ...'
pylint --rcfile=.pylintrc alignak_webui/
if [ $? -ne 0 ]; then
echo "pylint not compliant"
exit
fi
echo 'pep257 ...'
pep257 --select=D300 alignak_webui
if [ $? -ne 0 ]; then
echo "pep257 not compliant"
exit
fi
echo 'tests ...'
cd test
coverage erase
nosetests -xvv --nologcapture --process-restartworker --processes=1 --process-timeout=300 --with-coverage --cover-package=alignak_webui test_helper.py test_settings.py test_run.py test_alignak_webui.py
if [ $? -ne 0 ]; then
echo "main tests not compliant"
exit
fi
nosetests -xvv --process-restartworker --processes=1 --process-timeout=300 --with-coverage --cover-package=alignak_webui test_items.py test_backend_alignak.py test_datamanager.py test_datatable.py
if [ $? -ne 0 ]; then
echo "data tests not compliant"
exit
fi
nosetests -xvv --nologcapture --process-restartworker --processes=1 --process-timeout=300 --with-coverage --cover-package=alignak_webui test_web*.py
if [ $? -ne 0 ]; then
echo "web tests not compliant"
exit
fi
echo 'coverage combine ...'
coverage combine
coverage report -m
# cd ..
# mv test/.coverage . && coveralls -v