tox: 2.8.0: {[testenv]setenv} substitution broken

While installing tempest as part of devstack install, below commnd blows up with an error - tox -r --notest -efull

Error -

2017-09-01 18:22:20.661 | ++ lib/tempest:install_tempest:612          :   pushd /opt/stack/new/tempest
2017-09-01 18:22:20.661 | ~/tempest ~/devstack
2017-09-01 18:22:20.662 | ++ lib/tempest:install_tempest:613          :   tox -r --notest -efull
2017-09-01 18:22:21.720 | Traceback (most recent call last):
2017-09-01 18:22:21.720 |   File "/usr/local/bin/tox", line 11, in <module>
2017-09-01 18:22:21.720 |     sys.exit(cmdline())
2017-09-01 18:22:21.720 |   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 38, in main
2017-09-01 18:22:21.720 |     config = prepare(args)
2017-09-01 18:22:21.720 |   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 26, in prepare
2017-09-01 18:22:21.720 |     config = parseconfig(args)
2017-09-01 18:22:21.720 |   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 242, in parseconfig
2017-09-01 18:22:21.720 |     parseini(config, inipath)
2017-09-01 18:22:21.720 |   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 796, in __init__
2017-09-01 18:22:21.721 |     replace=name in config.envlist)
2017-09-01 18:22:21.721 |   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 827, in make_envconfig
2017-09-01 18:22:21.721 |     res = meth(env_attr.name, env_attr.default, replace=replace)
2017-09-01 18:22:21.721 |   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 964, in getdict_setenv
2017-09-01 18:22:21.721 |     definitions = self._getdict(value, default=default, sep=sep)
2017-09-01 18:22:21.721 |   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 975, in _getdict
2017-09-01 18:22:21.721 |     name, rest = line.split('=', 1)
2017-09-01 18:22:21.721 | ValueError: need more than 1 value to unpack
2017-09-01 18:22:21.733 | + lib/tempest:install_tempest:1            :   exit_trap

Logs link - http://logs.openstack.netapp.com/ci-logs/logs/65/499765/5/upstream-check/cinder-cDOT-FCP/3566c47/logs/devstacklog.txt.gz

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @obestwalter, I’ll try 2.8.1 out tomorrow and let you know how it goes.

https://github.com/tox-dev/tox/pull/521#discussion-diff-125055520R791 is the source of the bug. Basically if you run tox -efoo then config.envlist == [‘foo’] but tox will still attempt to parse envs bar and baz and foobar. But none of those will get replacements done beacuse those names are not in [‘foo’].

This isn’t a complete fix. The original tempest tox.ini now fails on missing boolean values when run against the commit above. I figured I’d throw something up before my day ends though.

{[testenv]setenv} breaks with the new changes looks like we don’t have a test for this substitution behaviour yet. I will create a reproducer and see if we can fix that with a quick bug fix soon. Please stick with 2.7 until then.

Here’s my tox.ini, if it helps:

[tox]
envlist = py36


[testenv]
deps =
    -rrequirements.txt
    flake8
    mypy
    pyflakes>=1.6.0
    pytest
    pytest-asyncio
passenv = ASYNC_TEST_TIMEOUT AWS_ACCESS_KEY_ID AWS_DEFAULT_REGION AWS_SECRET_ACCESS_KEY ORBIT_AWS__SERVICES__DYNAMODB__ENDPOINT_URL ORBIT_SERVICES__NEO4J__HOST ORBIT_SERVICES__REDIS__HOST
setenv =
    ORBIT_ENV = test
    ASYNC_TEST_TIMEOUT = 10
    AWS_DEFAULT_REGION = us-west-2
commands =
    flake8 orbit tests
    mypy --ignore-missing-imports orbit tests
    pytest {posargs} tests/unit
    pytest {posargs} tests/integration


[testenv:docker]
deps =
    flake8
    mypy
    pyflakes>=1.6.0
    pytest
    pytest-asyncio
sitepackages = True


[testenv:verbose]
setenv =
    {[testenv]setenv}
    ORBIT_AWS__SERVICES__DYNAMODB__ENDPOINT_URL = http://192.168.99.100:8000
    ORBIT_SERVICES__NEO4J__HOST = 192.168.99.100
    ORBIT_SERVICES__REDIS__HOST = 192.168.99.100
commands =
    pytest -s -vv {posargs}


[testenv:lint]
commands =
    flake8 orbit tests
    mypy --ignore-missing-imports orbit tests


[flake8]
ignore = E501