forked from crossbario/crossbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
156 lines (126 loc) · 4.88 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[tox]
envlist =
sphinx
flake8
bandit
coverage
{py38,pypy3}-{pinned,unpinned,abtrunk}-trial
{py38,pypy3}-cli
{py38,pypy3}-examples
[testenv]
whitelist_externals =
sh
cp
rm
sphinx
sphinx-build
coverage
bandit
flake8
deps =
coverage
-r{toxinidir}/requirements-latest.txt
examples: colorama
commands =
# in envs with "pinned", install hash-pinned deps (which is what we release in binaries)
pinned: pip install --ignore-installed --require-hashes -r {toxinidir}/requirements.txt
python -V
pip show twisted
pip show treq
python -c "from autobahn.wamp.serializer import JsonObjectSerializer, MsgPackObjectSerializer, CBORObjectSerializer, UBJSONObjectSerializer"
python -c "from twisted.python.compat import _PY3, unicode"
# in envs with "trial", install test/dev deps
trial: pip install -r {toxinidir}/requirements-dev.txt
# in envs with "cli", run crossbar CLI via a test shell script
cli: {toxinidir}/test/test_cli.sh
# in envs with "examples", run autobahn examples via test shell script
examples: {toxinidir}/test/test_ab_examples.sh
# in envs with "trial", run Twisted trial
trial: python -m twisted.trial crossbar
setenv =
{py38,pypy3}: CB_FULLTESTS = 1
[testenv:sphinx]
description =
Generate docs using Sphinx.
skip_install = False
deps =
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/requirements-latest.txt
commands =
# workaround for "pkg_resources.ContextualVersionConflict"
pip install --force-reinstall "urllib3<1.25,>=1.21.1"
# sphinxcontrib.images: avoid "RemovedInSphinx30Warning: sphinx.environment.NoUri is deprecated"
pip install --force-reinstall "sphinx<3"
# first test with all warnings fatal
sphinx-build -nWT -b dummy ./docs ./docs/_build
# run spell checker
sphinx-build -b spelling -d ./docs/_build/doctrees ./docs ./docs/_build/spelling
# generate HTML output
sphinx-build -b dirhtml ./docs ./docs/_build
# move to HOME to preserve on Travis for upload to S3
-rm -rf {homedir}/crossbar-docs
cp -R ./docs/_build {homedir}/crossbar-docs
[testenv:bandit]
skip_install = True
changedir = {toxinidir}
exclude = crossbar/worker/test/examples/syntaxerror.py
deps =
bandit
commands =
bandit -r -s B101,B110,B311 \
-x crossbar/common/key.py,crossbar/bridge/mqtt/test/test_wamp.py,crossbar/bridge/rest/test/__init__.py,crossbar/bridge/mqtt/test/test_wamp.py,crossbar/webservice/misc.py \
crossbar
[testenv:flake8]
skip_install = True
changedir = {toxinidir}
exclude = crossbar/worker/test/examples/syntaxerror.py
deps =
flake8
commands =
flake8 --ignore=E117,E402,F405,E501,E722,E741,E731,N801,N802,N803,N805,N806,W503,F523,F524 crossbar
# justification for ignoring W503 in the docs:
# https://www.flake8rules.com/rules/W503.html
[testenv:coverage]
skip_install = False
changedir = {toxinidir}
deps =
coverage
-r{toxinidir}/requirements-latest.txt
commands =
pip install -r {toxinidir}/requirements-dev.txt
# unit tests
coverage run --rcfile={toxinidir}/.coveragerc -m twisted.trial crossbar
# integration tests
rm -rf /tmp/test
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py version
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py init --appdir /tmp/test
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py status --cbdir /tmp/test/.crossbar
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py start --cbdir /tmp/test/.crossbar --shutdownafter=5
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py convert --cbdir /tmp/test/.crossbar
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py start --cbdir /tmp/test/.crossbar --shutdownafter=5
# test a node with all features ("full configuration")
coverage run --rcfile={toxinidir}/.coveragerc test/run_crossbar.py start --cbdir {toxinidir}/test/full/.crossbar --shutdownafter=15
# create coverage report
coverage combine --rcfile={toxinidir}/.coveragerc
coverage report --rcfile={toxinidir}/.coveragerc --omit="*/syntaxerror.py" --omit="*/test/*.py"
coverage html --rcfile={toxinidir}/.coveragerc --omit="*/syntaxerror.py" --omit="*/test/*.py"
setenv =
COVERAGE_PROCESS_START = {toxinidir}/.coveragerc
COVERAGE_FILE = {toxinidir}/.coverage
{py38,pypy3}: CB_FULLTESTS = 1
; [testenv:coverage-report]
; skip_install = True
; changedir = {toxinidir}
; deps =
; coverage
; commands=
; coverage combine --rcfile={toxinidir}/.coveragerc
; coverage report --rcfile={toxinidir}/.coveragerc --omit="*/syntaxerror.py" --omit="*/test/*.py"
; coverage html --rcfile={toxinidir}/.coveragerc --omit="*/syntaxerror.py" --omit="*/test/*.py"
; [testenv:coverage-erase]
; skip_install = True
; changedir = {toxinidir}
; deps =
; coverage
; commands =
; coverage erase