forked from ethereum/execution-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
235 lines (219 loc) · 7.03 KB
/
Copy pathtox.ini
File metadata and controls
235 lines (219 loc) · 7.03 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
[tox]
requires =
tox>=4,<5
tox-uv>=1.29,<2
# Get a description of all available environments with `uvx tox -av`
envlist =
py3
pypy3
json_infra
static
optimized
tests_pytest_py3
tests_pytest_pypy3
tests_benchmark_pytest_py3
benchmark-gas-values
benchmark-fixed-opcode-cli
benchmark-fixed-opcode-config
spec-docs
mkdocs
changelog
markdownlint
[testenv]
runner = uv-venv-lock-runner
uv_seed = false
wheel_build_env = .pkg
[testenv:static]
description = Run spelling, lint, typechecking and dependency checks
commands =
codespell
ruff check
ruff format --check
mypy
ethereum-spec-lint
uv lock --check
actionlint -pyflakes pyflakes -shellcheck "shellcheck -S warning"
[testenv:tests_pytest_py3]
description = Run the testing package unit tests (with Python)
changedir = {toxinidir}/packages/testing
package = editable
commands =
pytest \
-n {env:PYTEST_XDIST_AUTO_NUM_WORKERS:6} \
--basetemp="{temp_dir}/pytest" \
--ignore=src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_benchmarking.py \
--deselect=src/execution_testing/specs/tests/test_expect.py::test_log_mismatch_during_generation \
{posargs} \
src
[testenv:tests_pytest_pypy3]
description = Run the testing package unit tests (with PyPy)
# overwrite default groups (dev) to avoid installing optimized in tox envs using pypy
dependency_groups =
test
lint # TODO: add ruff for gentest; remove as part of ethereum/execution-specs#1715
passenv =
PYPY_GC_MAX
PYPY_GC_MIN
# run inside the package directory so pytest picks up packages/testing/pyproject.toml
changedir = {toxinidir}/packages/testing
package = editable
commands =
pytest \
-n auto --maxprocesses 6 \
--basetemp="{temp_dir}/pytest" \
--ignore=src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_benchmarking.py \
--deselect=src/execution_testing/specs/tests/test_expect.py::test_log_mismatch_during_generation \
{posargs} \
src
[testenv:tests_benchmark_pytest_py3]
description = Run benchmark framework unit tests (with Python)
# Running in serial as not many tests
commands =
pytest \
--basetemp="{temp_dir}/pytest" \
{posargs} \
packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_benchmarking.py
[testenv:json_infra]
description = Run the spec against released test fixtures
commands =
pytest \
-m "not slow" \
-n auto --maxprocesses 6 --dist=loadfile \
--basetemp="{temp_dir}/pytest" \
{posargs} \
tests/json_infra
[testenv:py3]
description = Fill the tests using EELS (with Python)
commands =
fill \
-m "not slow and not benchmark" \
# loadgroup: serialize xdist_group("bigmem") tests onto one worker to limit peak memory
-n {env:PYTEST_XDIST_AUTO_NUM_WORKERS:6} --dist=loadgroup \
--skip-index \
--cov-config=pyproject.toml \
--cov=ethereum \
--cov-report=term \
--cov-report "xml:{toxworkdir}/coverage.xml" \
--no-cov-on-fail \
--cov-branch \
--basetemp="{temp_dir}/pytest" \
--log-to "{toxworkdir}/logs" \
--clean \
--until BPO2 \
--durations=50 \
{posargs} \
tests
[testenv:pypy3]
description = Fill the tests using EELS (with PyPy)
# see comment for tests_pytest_pypy3
dependency_groups =
test
passenv =
PYPY_GC_MAX
PYPY_GC_MIN
commands =
fill \
--skip-index \
--no-html \
--tb=no \
--show-capture=no \
--disable-warnings \
-m "not slow and not benchmark and not derived_test" \
-n auto --maxprocesses 7 \
# loadgroup: serialize xdist_group("bigmem") tests onto one worker to limit peak memory
--dist=loadgroup \
--basetemp="{temp_dir}/pytest" \
--log-to "{toxworkdir}/logs" \
--clean \
--until BPO2 \
{posargs} \
tests
[testenv:optimized]
description = Run unit tests for optimized state and ethash
passenv =
PYPY_GC_MAX
PYPY_GC_MIN
commands =
pytest \
-m "not slow and not evm_tools" \
-n auto --maxprocesses 5 --dist=loadfile \
--ignore-glob='tests/test_t8n.py' \
--basetemp="{temp_dir}/pytest" \
--optimized \
{posargs} \
tests/json_infra
[testenv:benchmark-gas-values]
description = Run benchmark tests with `--gas-benchmark-values`
passenv =
EVM_BIN
commands =
fill \
--evm-bin={env:EVM_BIN:evmone-t8n} \
--gas-benchmark-values 1 \
--generate-pre-alloc-groups \
--fork Osaka \
-m "benchmark and not slow" \
-n auto --maxprocesses 10 --dist=loadgroup \
--basetemp="{temp_dir}/pytest" \
--log-to "{toxworkdir}/logs" \
--clean \
{posargs} \
tests/benchmark
[testenv:benchmark-fixed-opcode-cli]
description = Run benchmark tests with `--fixed-opcode-count 1`
passenv =
EVM_BIN
commands =
fill \
--evm-bin={env:EVM_BIN:evmone-t8n} \
--fixed-opcode-count 1 \
--fork Prague \
-m repricing \
-n auto --maxprocesses 10 --dist=loadgroup \
# TODO: remove skip once working for all precompiles PR#1955
-k "not test_alt_bn128 and not test_bls12_381 and not test_modexp" \
--basetemp="{temp_dir}/pytest" \
--log-to "{toxworkdir}/logs" \
--clean \
{posargs} \
tests/benchmark
[testenv:benchmark-fixed-opcode-config]
description = Run `benchmark_parser` and the benchmark tests using the generated file
passenv =
EVM_BIN
commands =
benchmark_parser
fill \
--evm-bin={env:EVM_BIN:evmone-t8n} \
--fixed-opcode-count \
--fork Prague \
-m repricing \
-n auto --maxprocesses 10 --dist=loadgroup \
# TODO: remove skip once working for all precompiles PR#1955
-k "not test_alt_bn128 and not test_bls12_381 and not test_modexp" \
--basetemp="{temp_dir}/pytest" \
--log-to "{toxworkdir}/logs" \
--clean \
{posargs} \
tests/benchmark
[testenv:spec-docs]
description = Generate documentation for the specification code using docc
basepython = python3
commands =
docc --output "{toxworkdir}/docs"
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs" / "index.html"))'
[testenv:mkdocs]
description = Build HTML site documentation with mkdocs
setenv =
GEN_TEST_DOC_VERSION = "tox"
# Set DYLD_FALLBACK_LIBRARY_PATH: Required for `cairosvg` so tox can find `libcairo-2`?
# https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/?h=cairo#cairo-library-was-not-found
DYLD_FALLBACK_LIBRARY_PATH = /opt/homebrew/lib
commands =
mkdocs build --strict
[testenv:changelog]
description = Validate docs/CHANGELOG.md entries
commands = validate_changelog
[testenv:markdownlint]
description = Lint markdown files (markdownlint)
commands = markdownlintcli2_soft_fail