forked from crossbario/crossbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
147 lines (119 loc) · 4.35 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
[tox]
envlist =
sphinx
flake8
bandit
coverage
{py36,pypy3}-{pinned,unpinned,abtrunk}-trial
{py36,pypy3}-cli
{py36,pypy3}-examples
[testenv]
whitelist_externals =
sh
cp
rm
sphinx
sphinx-build
coverage
bandit
flake8
deps =
coverage
# use Autobahn master branch (in case we changed stuff there we depend on here)
abtrunk: https://github.com/crossbario/autobahn-python/archive/master.zip
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
# 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 =
{py36,pypy3}: CB_FULLTESTS = 1
[testenv:sphinx]
description =
Generate docs using Sphinx.
skip_install = False
deps =
sphinx
sphinx_rtd_theme
pyenchant
sphinxcontrib_spelling
commands =
# 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 html ./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
basepython = python3.6
[testenv:flake8]
skip_install = True
changedir = {toxinidir}
exclude = crossbar/worker/test/examples/syntaxerror.py
deps =
flake8
commands =
flake8 --ignore=E402,F405,E501,E722,E741,E731,N801,N802,N803,N805,N806 crossbar
basepython = python3.6
[testenv:coverage]
skip_install = False
changedir = {toxinidir}
deps =
coverage
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
{py36,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