Skip to content

Commit ab50304

Browse files
committed
Fix broken Travis tests - get test setup from mod-livestatus
Scheduler broks is an array not a dict
1 parent 1fae6b6 commit ab50304

File tree

9 files changed

+1379
-333
lines changed

9 files changed

+1379
-333
lines changed

.pylintrc

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

.travis.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
language: python
22
python:
33
- "2.7"
4-
- "2.6"
54

65
install:
6+
- sudo apt-get update && sudo apt-get install -y python-pip libgnutls28-dev libssl-dev
77
- ./test/setup_module_test.sh
8-
- pip install importlib # this is a requirement of shinken
9-
- export PYTHONPATH=$PYTHONPATH:~/shinken # we need shinken..
10-
- export PYTHONPATH=$PYTHONPATH:~/shinken/test
11-
- export PYTHONPATH=$PYTHONPATH:~/mod-livestatus/test # we also need mock_livestatus from mod-livestatus..
128

139
script:
14-
- mongodir=$(pwd)
15-
# tests need to run from shinken test directory for access to test config files
16-
# (as long as the test config files are referenced with a relative path)
17-
- cd ~/shinken/test
18-
- nosetests -vx --with-coverage --cover-package=modules $mongodir/test
10+
# Unit tests
11+
- cur_dir=$PWD
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+
- export PYTHONPATH=$PYTHONPATH:$PWD/test/tmp/shinken/test/modules/livestatus # we also need mock_livestatus from mod-livestatus..
17+
- echo "Python path '$PYTHONPATH' ..."
18+
- cd test/tmp/shinken/test
19+
# - pytest -vv --durations=0 --no-print-logs --cov="$cur_dir"/module --cov-config "$cur_dir"/test/.coveragerc "$cur_dir"/test/test_*.py
20+
- pytest -vv --durations=0 --no-print-logs --cov="$cur_dir"/module --cov-report=xml --cov-config "$cur_dir"/test/.coveragerc "$cur_dir"/test/test_*.py
21+
22+
# Static code analysis
23+
- cd "$cur_dir"
24+
# -- pycodestyle (former pep8)
25+
# E731 do not assign a lambda expression, use a def
26+
- pycodestyle --max-line-length=120 --ignore=E402,W503,E731 --exclude='*.pyc' module
27+
# -- pylint
28+
- pylint --rcfile=.pylintrc -r no module
29+
# -- pep257
30+
# - pep257 --select=D300 alignak
1931

2032
after_success:
21-
coveralls
33+
- bash <(curl -s https://codecov.io/bash) -f test/tmp/shinken/test/coverage.xml
2234

2335
notifications:
2436
email: false

0 commit comments

Comments
 (0)