Skip to content

Commit a62c679

Browse files
committed
Try to fix broken test
1 parent 1c6c5d5 commit a62c679

File tree

10 files changed

+966
-480
lines changed

10 files changed

+966
-480
lines changed

.pylintrc

Lines changed: 597 additions & 0 deletions
Large diffs are not rendered by default.

.travis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,34 @@ python:
44

55
install:
66
- sudo apt-get update && sudo apt-get install -y python-pip libgnutls28-dev libssl-dev
7-
# python-pycurl python-cherrypy3
87
- ./test/setup_module_test.sh
9-
- pip install importlib # this is a requirement of shinken
108

119
script:
10+
# Unit tests
1211
- cur_dir=$PWD
13-
- export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken # we need shinken..
14-
# - export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken/test
15-
# - export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken/test/modules
12+
- echo "Current directory '$cur_dir' ..."
13+
- export PYTHONPATH=$PYTHONPATH:$PWD
14+
- export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken # we also need shinken test/modules...
15+
- export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken/test # we also need shinken test/modules...
1616
- export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken/test/modules/livestatus # we also need mock_livestatus from mod-livestatus..
17-
- echo $PYTHONPATH
17+
- echo "Python path '$PYTHONPATH' ..."
1818
- cd test/tmp/shinken/test
19-
- nosetests -vx --process-restartworker --processes=1 --process-timeout=1800 "$cur_dir/test"
20-
- coverage combine
19+
- pytest -vv --durations=0 --no-print-logs --cov="$cur_dir"/module --cov-config "$cur_dir"/test/.coveragerc "$cur_dir"/test/test_*.py
20+
21+
- bash <(curl -s https://codecov.io/bash) -e tests_mod_logstore_mongodb -c -F tests_mod_logstore_mongodb
22+
23+
# Static code analysis
24+
- cd "$cur_dir"
25+
# -- pycodestyle (former pep8)
26+
# E731 do not assign a lambda expression, use a def
27+
- pycodestyle --max-line-length=120 --ignore=E402,W503,E731 --exclude='*.pyc' module
28+
# -- pylint
29+
- pylint --rcfile=.pylintrc -r no module
30+
# -- pep257
31+
# - pep257 --select=D300 alignak
2132

2233
after_success:
23-
coveralls
34+
- bash <(curl -s https://codecov.io/bash) -e tests_mod_logstore_mongodb -c -F tests_mod_logstore_mongodb
2435

2536
notifications:
2637
email: false

0 commit comments

Comments
 (0)