This repository has been archived by the owner on Jul 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
/
tox.ini
173 lines (151 loc) · 7.46 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
[tox]
envlist=
py{37,38}-{eth1-core,p2p,p2p-trio,integration,sync_integration,eth1-components}
py37-long_run_integration
py37-rpc-state-{fork-transition,frontier,homestead,tangerine_whistle,spurious_dragon,byzantium,constantinople,petersburg,istanbul,berlin}
py37-rpc-state-{quadratic,sstore,zero_knowledge}
py{38,37}-lint
py{38,37}-wheel-cli
py37-docs
[flake8]
max-line-length= 100
exclude=
ignore=W504,W503
[isort]
force_sort_within_sections=True
known_third_party=async_service,asyncio_run_in_process,hypothesis,pytest,async_generator,cytoolz,trio_typing,pytest_trio,factory,eth_tester
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
[pytest]
# If you are getting hard-to-diagnose timeouts, try switching '-n 4' to:
# --tx '4*popen//execmodel=eventlet'
# See commit 9d492239ad3fbcc40fee9545d66f8b35262427f2 for background
addopts=--max-fail=10 -n 4
[testenv]
usedevelop=True
setenv =
MYPYPATH = {toxinidir}/stubs
passenv =
TRAVIS_EVENT_TYPE
commands=
eth1-core: pytest {posargs:tests/core/}
p2p: pytest {posargs:tests/p2p}
p2p-trio: pytest {posargs:tests-trio/p2p-trio}
eth1-components: pytest {posargs:tests/components/tx_pool/}
# Fixtures that test transitioning from one VM to another. These are otherwise filtered out by
# the --fork <ForkName> mechanism because they have a fork such as `FrontierToHomesteadAt5`
rpc-state-fork-transition: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'BlockchainTests/TransitionTests'}
# Fork/VM-specific state transition tests; long-running categories run separately!
rpc-state-frontier: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork Frontier -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-homestead: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork Homestead -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-tangerine_whistle: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork EIP150 -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-spurious_dragon: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork EIP158 -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
# The following test seems to consume a lot of memory. Restricting to 3 processes reduces crashes
rpc-state-byzantium: pytest -n 3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork Byzantium -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-constantinople: pytest -n 3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork Constantinople -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-petersburg: pytest -n 3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork ConstantinopleFix -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-istanbul: pytest -n 2 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork Istanbul -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
rpc-state-berlin: pytest -n 2 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py --fork Berlin -k 'not stQuadraticComplexityTest and not stSStoreTest and not stZeroKnowledge'}
# Long-running categories.
rpc-state-quadratic: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stQuadraticComplexityTest'}
rpc-state-sstore: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stSStoreTest'}
rpc-state-zero_knowledge: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stZeroKnowledge'}
sync_integration: pytest -s --integration {posargs:tests/integration/test_sync.py --log-cli-level=debug}
deps = .[p2p,trinity,test,test-asyncio]
basepython =
py37: python3.7
py38: python3.8
[testenv:py38-p2p-trio]
deps = .[p2p,test,test-trio]
commands = pytest {posargs:tests-trio/p2p-trio}
[testenv:py37-p2p-trio]
deps = .[p2p,test,test-trio]
commands = pytest {posargs:tests-trio/p2p-trio}
[testenv:py37-docs]
whitelist_externals=
make
deps = .[p2p, trinity, doc]
passenv =
TRAVIS_EVENT_TYPE
commands=
make validate-docs
[common-wheel-cli]
deps=
pexpect
pytest
pytest-asyncio
wheel
whitelist_externals=
/bin/rm
/bin/bash
/bin/cd
commands=
/bin/rm -rf build dist
python setup.py sdist bdist_wheel
/bin/bash -c 'pip install --upgrade "$(ls dist/*.whl)""[p2p,trinity]" --progress-bar off'
pytest {posargs:tests/integration/ -k 'trinity_cli' --log-cli-level 0}
[testenv:py38-wheel-cli]
deps = {[common-wheel-cli]deps}
whitelist_externals = {[common-wheel-cli]whitelist_externals}
commands = {[common-wheel-cli]commands}
skip_install=true
usedevelop=false
[testenv:py37-wheel-cli]
deps = {[common-wheel-cli]deps}
whitelist_externals = {[common-wheel-cli]whitelist_externals}
commands = {[common-wheel-cli]commands}
skip_install=true
usedevelop=false
[common-integration]
deps = .[p2p,trinity,test,test-asyncio]
passenv =
TRAVIS_EVENT_TYPE
TRINITY_ETHERSCAN_API_KEY
commands=
pip install -e {toxinidir}/trinity-external-components/examples/peer_count_reporter
# We don't want to run these tests concurrently to avoid running into errors
# due to multiple Trinity instances competing for the same ports
# The `trinity_cli` tests are already run by the pyxx-wheel-cli jobs. No need to repeat them here
pytest --integration -n 1 {posargs:tests/integration/ -k 'not sync_integration and not trinity_cli'}
[testenv:py38-integration]
deps = {[common-integration]deps}
passenv = {[common-integration]passenv}
commands = {[common-integration]commands}
[testenv:py37-integration]
deps = {[common-integration]deps}
passenv = {[common-integration]passenv}
commands = {[common-integration]commands}
[testenv:py37-long_run_integration]
deps = {[common-integration]deps}
passenv = {[common-integration]passenv}
commands =
pytest -s {posargs:tests/trinity_long_run/ --log-cli-level DEBUG}
[common-lint]
deps = .[p2p,trinity,lint]
commands=
flake8 --config {toxinidir}/tox.ini {toxinidir}/p2p
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/__init__.py
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/conftest.py
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/core
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/integration
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/json-fixtures-over-rpc
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/p2p
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/p2p-trio
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/components
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests/trinity_long_run
flake8 --config {toxinidir}/tox.ini {toxinidir}/tests-trio
flake8 --config {toxinidir}/tox.ini {toxinidir}/trinity
flake8 --config {toxinidir}/tox.ini {toxinidir}/scripts
flake8 --config {toxinidir}/tox.ini {toxinidir}/setup.py
mypy -p trinity --config-file {toxinidir}/mypy.ini
mypy -p scripts --config-file {toxinidir}/mypy.ini
mypy -p p2p --config-file {toxinidir}/mypy.ini
[testenv:py38-lint]
deps = {[common-lint]deps}
commands= {[common-lint]commands}
[testenv:py37-lint]
deps = {[common-lint]deps}
commands= {[common-lint]commands}