@@ -4,23 +4,34 @@ python:
4
4
5
5
install :
6
6
- sudo apt-get update && sudo apt-get install -y python-pip libgnutls28-dev libssl-dev
7
- # python-pycurl python-cherrypy3
8
7
- ./test/setup_module_test.sh
9
- - pip install importlib # this is a requirement of shinken
10
8
11
9
script :
10
+ # Unit tests
12
11
- 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...
16
16
- 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' ..."
18
18
- 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
21
32
22
33
after_success :
23
- coveralls
34
+ - bash <(curl -s https://codecov.io/bash) -e tests_mod_logstore_mongodb -c -F tests_mod_logstore_mongodb
24
35
25
36
notifications :
26
37
email : false
0 commit comments