forked from iot-lab/iot-lab-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
112 lines (90 loc) · 2.62 KB
/
tox.ini
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[tox]
envlist = copying, test, code_check, control_node_serial
# infos:
# can't hide return value before tox 1.9
# and can't do bash stuff directly, so call bash
[testenv]
basepython = python2
passenv = IOTLAB_GATEWAY_CFG_DIR
[testenv:test]
whitelist_externals =
/bin/bash
/usr/bin/make
deps = -rtests_utils/test-requirements.txt
commands =
{[testenv:pytest]commands} -s --pep8 {posargs}
commands_post =
{[testenv:clean_test_files]commands}
[testenv:upload_coverage]
deps = -rtests_utils/test-requirements.txt
passenv = CI TRAVIS TRAVIS_*
commands = codecov
[testenv:copying]
whitelist_externals = /bin/bash
commands=
bash tests_utils/check_license.sh
[testenv:code_check]
whitelist_externals = /bin/bash
deps = -rtests_utils/test-requirements.txt
commands =
bash -c "set -o pipefail;python setup.py lint | tee pylint.out"
bash -c "set -o pipefail;flake8 | tee flake8.out"
[testenv:integration]
whitelist_externals =
/bin/bash
/bin/echo
/usr/bin/make
/usr/bin/codecov
sitepackages = True
passenv = CODECOV_CMD
commands =
# Tests should be run as user 'www-data'
bash -c "test {env:USER} == www-data"
bash -c "python setup.py build_ext" # build control_node_serial
# run the full test suite with coverage
bash -c "{[testenv:pytest]commands} -s -x {posargs}"
# Run codecov command if passed via environment variable, otherwise do
# nothing.
# codecov command should be in the form: codecov -t <codecov_token>
{env:CODECOV_CMD:echo -n}
commands_post =
{[testenv:clean_test_files]commands}
[testenv:local]
deps = -rtests_utils/test-requirements.txt
whitelist_externals =
/bin/bash
/usr/bin/make
commands =
bash -c "if [ -z '$IOTLAB_GATEWAY_CFG_DIR' ]; then \
export IOTLAB_GATEWAY_CFG_DIR={posargs:tests_utils/cfg_dir/}; \
fi; \
export IOTLAB_USERS=/tmp/users;\
{[testenv:pytest]commands} --pep8 -x {posargs}"
commands_post =
{[testenv:clean_test_files]commands}
[testenv:pytest]
# Shared pytest command
commands = pytest --cov=gateway_code --cov-report=xml --cov-report=term --cov-report=term-missing
[testenv:clean_test_files]
whitelist_externals =
/usr/bin/make
commands =
# Get rid of pytest ImportMismatchError for future runs (either locally
# or via docker)
make clean-test-files
[testenv:control_node_serial]
skip_install = True
sitepackages = True
deps = gcovr
whitelist_externals =
/usr/bin/make
/bin/bash
commands =
make -C control_node_serial realclean coverage
[testenv:doc]
whitelist_externals =
make
deps =
sphinx
commands =
make -C doc clean html