forked from Checkmk/checkmk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
65 lines (65 loc) · 2.29 KB
/
.travis.yml
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
# This is a simple entry point to execute the basic and most important Python
# tests for Checkmk. We run tools like pylint, yapf and our py.test based unit
# tests here. Some tests, like integration tests or tests of very specific
# components are not executed.
#
# We focus on the tests that are needed by external developers, e.g. to support
# check plugin development.
---
language: python
matrix:
include:
# Execute all these targets in parallel
- name: "Python2 PyLint tests"
python: "2.7"
env: TEST_TARGETS="test-pylint"
TEST_PATH=tests
- name: "Python2 unit, futurize and bandit tests"
python: "2.7"
env: TEST_TARGETS="test-unit test-python-futurize test-bandit"
TEST_PATH=tests
- name: "Python2 formatting"
python: "2.7"
env: TEST_TARGETS="test-format-python"
TEST_PATH=tests
- name: "Python3 PyLint tests"
python: "3.7"
env: TEST_TARGETS="test-pylint"
TEST_PATH=tests-py3
- name: "Python3 unit tests"
python: "3.7"
env: TEST_TARGETS="test-unit"
TEST_PATH=tests-py3
- name: "Python3 typing tests"
python: "3.7"
env: TEST_TARGETS="test-mypy-raw"
TEST_PATH=tests-py3
env:
global:
# Optimize builds by caching pip and pipenv things
- PIP_CACHE_DIR=$HOME/.cache/pip
- PIPENV_CACHE_DIR=$HOME/.cache/pipenv
# Don't use travis venv, build our own
- PIPENV_IGNORE_VIRTUALENVS=1
# Disable some annoying warnings
- PYTHONWARNINGS=ignore::DeprecationWarning
cache:
directories:
- $PIP_CACHE_DIR
- $PIPENV_CACHE_DIR
addons:
apt:
packages:
# Needed for some "unit test" (test_mk_errpt_aix).
- ksh
# Needed for building rrdtool python bindings
- librrd-dev
install:
- pip install pipenv
- make -C virtual-envs/$TRAVIS_PYTHON_VERSION .venv
script:
# TODO: Some tests could be optimized for better execution time. For
# example test-format-python optionally checks only the files in set in
# the environment variable PYTHON_FILES. Without it, it always checks
# all known python files.
- travis_wait 30 make -C $TEST_PATH $TEST_TARGETS;