tox.ini 2.62 KB
Newer Older
1
[tox]
2
skip_missing_interpreters = True
juga's avatar
juga committed
3
envlist = py35, py36, inst, setup, unit, integration, lint, stats, doc
Matt Traudt's avatar
Matt Traudt committed
4
5
6

[travis]
python =
juga's avatar
juga committed
7
    3.5: py35, inst, setup, unit, integration, lint, doc, doclinks
8
    3.6: py36, inst, setup, unit, integration
9

juga's avatar
juga committed
10
[testenv]
11
# install_command can be removed when --process-dependency-links is not
12
13
# needed anymore, and this section commented
# install_command = pip install {opts} {packages}
14

15
16
17
18
19
20
# test that it can be installed with custom commands and clean env
[testenv:inst]
skip_install = True
commands =
    # this will fail until --process-dependency-links is not needed
    # it needs to be commented since error code will be still 1
21
    - pip install .
22
23
24
25
26
ignore_errors = True
recreate = True

[testenv:setup]
skip_install = True
juga's avatar
juga committed
27
28
    # this will fail until --process-dependency-links is not needed
    # it needs to be commented since error code will be still 1
29
commands = python setup.py install
30
recreate = True
31
32

[testenv:unit]
juga's avatar
juga committed
33
34
35
36
deps = .[test]
commands =
    coverage run -a --rcfile={toxinidir}/.coveragerc --source=sbws -m pytest \
        -s {toxinidir}/tests/unit -vv
juga's avatar
juga committed
37

38
39
40
41
[testenv:integration]
ignore_errors = True
deps = .[test]
whitelist_externals =
42
    cp
43
    bash
44
    sleep
45
    wget
juga's avatar
juga committed
46
    mkdir
47
commands =
48
    cp -af {toxinidir}/tests/integration/net {envtmpdir}
49
    bash {envtmpdir}/net/start.sh
50
    bash -c "time python3 {envtmpdir}/net/wait.py {envtmpdir}/net/{auth,relay,exit}*"
51
    bash -c "python3 {toxinidir}/scripts/tools/sbws-http-server.py --port 28888 &>/dev/null &"
juga's avatar
juga committed
52
    sleep 1
53
    wget -O/dev/null http://127.0.0.1:28888/sbws.bin
juga's avatar
juga committed
54
55
56
57
    ; Run actually the scanner
    mkdir -p /tmp/.sbws
    ; This add around 3min more to the tests
    sbws -c {toxinidir}/tests/integration/sbws_testnet.ini scanner
58
59
    coverage run -a --rcfile={toxinidir}/.coveragerc --source=sbws -m pytest -s {toxinidir}/tests/integration -vv
    bash {envtmpdir}/net/stop.sh
60
    # no need to remove .tox/net directory.
juga's avatar
juga committed
61
    rm -rf /tmp/.sbws
62

juga's avatar
juga committed
63
64
65
[testenv:lint]
skip_install = True
deps = .[dev]
juga's avatar
juga committed
66
commands = flake8 sbws scripts tests
juga's avatar
juga committed
67

juga's avatar
juga committed
68
69
70
71
72
73
[testenv:clean]
skip_install = True
changedir={toxinidir}
deps = coverage
command = coverage erase

juga's avatar
juga committed
74
75
76
[testenv:stats]
skip_install = True
changedir={toxinidir}
juga's avatar
juga committed
77
deps = .[test]
juga's avatar
juga committed
78
commands=
juga's avatar
juga committed
79
80
81
82
    # nothing to combine while not using several python versions
    # coverage combine
    coverage report
    coverage html
juga's avatar
juga committed
83
84
85
86
87
88
89
90
91

[testenv:doc]
deps = .[doc]
whitelist_externals = make
changedir = docs
commands =
    make html
    # this requires build the pdf images
    # make latexpdf
juga's avatar
juga committed
92
    make man
juga's avatar
juga committed
93
94
95
96
97
98
99
100

# this requires Internet, it should not be in envlist
[testenv:doclinks]
deps = .[doc]
whitelist_externals = make
changedir = docs
commands =
    make linkcheck