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 Jan 11, 2019
1 parent 2379a7e commit b0ba2f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pytest.ini
@@ -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
25 changes: 11 additions & 14 deletions tox.ini
Expand Up @@ -15,21 +15,20 @@ ignore=
[testenv]
usedevelop=True
passenv =
PYTEST_ADDOPTS
TRAVIS_EVENT_TYPE
commands=
core: pytest {posargs:tests/core/}
eth2: pytest {posargs:tests/eth2}
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-tangerine_whistle: pytest {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP150'}
rpc-state-spurious_dragon: 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/}
eth2: pytest -n 4 {posargs:tests/eth2}
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-tangerine_whistle: pytest -n 4 {posargs:tests/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP150'}
rpc-state-spurious_dragon: 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 @@ -44,7 +43,6 @@ whitelist_externals=
make
deps = .[p2p, trinity, doc]
passenv =
PYTEST_ADDOPTS
TRAVIS_EVENT_TYPE
commands=
make validate-docs
Expand Down Expand Up @@ -82,7 +80,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 b0ba2f9

Please sign in to comment.