Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Stop using PYTEST_ADDOPTS in CircleCI to run xdist
Browse files Browse the repository at this point in the history
xdist was not using the locally packaged trinity for tests,
so we had to disable it to correctly test packages.
But when xdist is removed, the -n parameter
that's in the environment causes pytest to fail.

Having a different environment on circle than local tests is likely to
cause future problems of a similar variety anyway, so let's just remove
the variable. This requires manually setting '-n 4' on the tests that
make sense with it, but making that value explicit seems like an
improvement.
  • Loading branch information
carver committed Dec 22, 2018
1 parent 350130e commit a7accd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
addopts= --showlocals
addopts= --showlocals --durations 50 --maxfail 10
python_paths= .
xfail_strict=true
log_format = %(levelname)8s %(asctime)s %(filename)20s %(message)s
Expand Down
23 changes: 10 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@ ignore=
[testenv]
usedevelop=True
passenv =
PYTEST_ADDOPTS
TRAVIS_EVENT_TYPE
commands=
core: pytest {posargs:tests/core/}
p2p: pytest {posargs:tests/p2p}
rpc-blockchain: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'not GeneralStateTests'}
rpc-state-frontier: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Frontier'}
rpc-state-homestead: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Homestead'}
rpc-state-eip150: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP150'}
rpc-state-eip158: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP158'}
core: pytest -n 4 {posargs:tests/core/}
p2p: pytest -n 4 {posargs:tests/p2p}
rpc-blockchain: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'not GeneralStateTests'}
rpc-state-frontier: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Frontier'}
rpc-state-homestead: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Homestead'}
rpc-state-eip150: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP150'}
rpc-state-eip158: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP158'}
# The following test seems to consume a lot of memory. Restricting to 3 processes reduces crashes
rpc-state-byzantium: pytest -n3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Byzantium'}
rpc-state-constantinople: pytest -n3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Constantinople'}
rpc-state-quadratic: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stQuadraticComplexityTest'}
rpc-state-byzantium: pytest -n 3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Byzantium'}
rpc-state-constantinople: pytest -n 3 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Constantinople'}
rpc-state-quadratic: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stQuadraticComplexityTest'}
lightchain_integration: pytest --integration {posargs:tests/integration/test_lightchain_integration.py}

deps = .[p2p,trinity,test]
Expand All @@ -43,7 +42,6 @@ whitelist_externals=
make
deps = .[p2p, trinity, doc]
passenv =
PYTEST_ADDOPTS
TRAVIS_EVENT_TYPE
commands=
make validate-docs
Expand Down Expand Up @@ -81,7 +79,6 @@ use_develop=false
[common-integration]
deps = .[p2p,trinity,test]
passenv =
PYTEST_ADDOPTS
TRAVIS_EVENT_TYPE
commands=
pip install -e {toxinidir}/trinity-external-plugins/examples/peer_count_reporter
Expand Down

0 comments on commit a7accd5

Please sign in to comment.