-
Notifications
You must be signed in to change notification settings - Fork 15
/
tox.ini
108 lines (90 loc) · 2.44 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
[tox]
envlist = copying,{py37,py38,py39,py310}-{tests,lint}
skip_missing_interpreters = true
[testenv]
passenv = IOTLAB_GATEWAY_CFG_DIR
deps=
-rtests_utils/test-requirements.txt
commands=
tests: {[testenv:tests]commands}
lint: {[testenv:lint]commands}
[testenv:tests]
allowlist_externals =
/bin/bash
/usr/bin/bash
/usr/bin/make
deps = -rtests_utils/test-requirements.txt
commands =
{[testenv:pytest]commands} -s {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]
allowlist_externals =
/bin/bash
/usr/bin/bash
commands=
bash tests_utils/check_license.sh
[testenv:lint]
deps = -rtests_utils/test-requirements.txt
commands =
pycodestyle gateway_code setup.py
pylint --rcfile=setup.cfg gateway_code setup.py
flake8
[testenv:integration]
allowlist_externals =
/bin/bash
/usr/bin/bash
/bin/echo
/usr/bin/make
/usr/bin/codecov
/usr/bin/test
sitepackages = True
passenv =
CODECOV_CMD
IOTLAB_GATEWAY_CFG_DIR
commands =
# Tests should be run as user 'www-data'
bash -c "test {env:USER} == www-data"
# 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
allowlist_externals =
/bin/bash
/usr/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]
allowlist_externals =
/usr/bin/make
commands =
# Get rid of pytest ImportMismatchError for future runs (either locally
# or via docker)
make clean-test-files
[testenv:doc]
allowlist_externals =
make
deps =
sphinx
commands =
make -C doc clean html