-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.8.0: {[testenv]setenv} substitution broken #595
Comments
Thanks @yogi-sagar - I will have a look right away. |
@obestwalter This broke my builds as well (looks like the same error):
|
Here's my
|
|
#521 (diff) is the source of the bug. Basically if you run |
Project: openstack-infra/project-config 0bcbb286b03007d87c217703605a77969a2d1cfb Pin tox to 2.7.0 There is a fun new bug [0] in tox 2.8.0 that affects tempest. To avoid this crashing everything to a hault pin to 2.7.0 for now. [0] tox-dev/tox#595 Change-Id: I811fa4c71b63cfa39c3fd1018f9e3d3117ee2300
There is a fun new bug [0] in tox 2.8.0 that affects tempest. To avoid this crashing everything to a hault pin to 2.7.0 for now. [0] tox-dev/tox#595 Change-Id: I811fa4c71b63cfa39c3fd1018f9e3d3117ee2300
Digging in more I see two potential "fixes" for the original issue #515. The first one is more of a workaround. Just set a default on all env vars (granted you may want to fail in some cases rather than relying on a default so maybe this isn't so great). The other is always replace internal tox key:value pairs and treat the replace flag as an indication of whether or not you should replace external key:value pairs. Or maybe just add another flag for external vs internal. But I am not familiar with this code base so will defer to others. |
minimal reproducer for this is:
|
@cboylan - if you want to try for a fix, have a go - reproducer is in place - it's getting late here on this side of the planet, so I might have a look tomorrow :) |
When reading in the config and processing dict content we were splitting on = assuming we would always have key = value pairs. However in the case where we don't want to replace because the testenv will not be used this can result in ValueErrors as substitution variables are not string key = value pairs. Avoid all this by only attempting to process dict key = values if we are replacing in the first place. Otherwise the content isn't needed and we just return the default value or empty dict. This should fix tox-dev#595
When reading in the config and processing dict content we were splitting on = assuming we would always have key = value pairs. However in the case where we don't want to replace because the testenv will not be used this can result in ValueErrors as substitution variables are not string key = value pairs. Avoid all this by only attempting to process dict key = values if we are replacing in the first place. Otherwise the content isn't needed and we just return the default value or empty dict. This should fix tox-dev#595
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. |
Let's keep this open until the fix is out ... |
I pushed a test package with the completed fix to devpi if somebody wants to test this:
I tried already with tempest and that works again. |
Project: openstack-infra/puppet-jenkins 5fc0bbbdb3d549bd0088e866180881b541da5646 Pin tox to 2.7.0 Tox 2.8.0 has broke us, clarkb has a patch upstream to fix. In the mean time, we can pin to 2.7.0. tox-dev/tox#595 Change-Id: I1079fb1bc6606a33b5b2517cca0c8eba2c12ce13 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Tox 2.8.0 has broke us, clarkb has a patch upstream to fix. In the mean time, we can pin to 2.7.0. tox-dev/tox#595 Change-Id: I1079fb1bc6606a33b5b2517cca0c8eba2c12ce13 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changed the implementation
|
Last dev version before release (I promise):
|
I think I will merge the fix and release a bugfix update today. If someone could review first it would be nice, but I am pretty confident that the fix does not make things worse ... |
* #595 fix by updating implementation of #515 The way #515 was implemented did not play nicely with env var substitution. This might render the former additions completely or partially obsolete but I did not check this yet. First let's fix that bug. * fix flakes (cherry picked from commit e902f04) * #595 fix by updating implementation of #515 The way #515 was implemented did not play nicely with env var substitution. This might render the former additions completely or partially obsolete but I did not check this yet. First let's fix that bug. Instead of crashing early on testenv creation if the substitution the missing substitution keys are added to a list attached to TestenvConfig. This way it is not necessary anymore to provide everything needed to resolve all testenvs but instead only what is needed to resolve all testenvs that are part of this restrun. Implementation notes: The first implementation used a module level mapping from envname to missing substitutions, which was ugly. Instead the information is bubbled up as an exception where it can be handled the way it is needed in the contexts where the information can be either translated into a crashing error or attached to the object which should carry the information (in this case TestenvConfig). Atm a missing substitution in a testenv is not being left empty but filled with a special value 'TOX_MISSING_SUBSTITUTION', this is not exactly necessary, but I don't feel comfortable enough yet to leave it empty, this can help with debugging potential problems that might arise from this change. * #595 missed a bit Crash only if actually trying to run a testenv with missing substitutions * fix error on execution Instead of crashing the whole thing again - only later, do it the right way by setting venv.status with the error to be reported later. * #595 tests and last touches * catch MissingSubstition from all method calls for consistency * set status and stop execution in setupvenv if substutions are missing to prevent errors occuring there with missing substitutions
Fixed in 2.8.1 |
Thanks @obestwalter, I'll try 2.8.1 out tomorrow and let you know how it goes. |
While installing tempest as part of devstack install, below commnd blows up with an error -
tox -r --notest -efull
Error -
Logs link - http://logs.openstack.netapp.com/ci-logs/logs/65/499765/5/upstream-check/cinder-cDOT-FCP/3566c47/logs/devstacklog.txt.gz
The text was updated successfully, but these errors were encountered: