[all][gate][stable] Pinning tox<4 in stable branch testing

Clark Boylan cboylan at sapwetik.org
Sat Jan 7 02:12:15 UTC 2023


On Fri, Jan 6, 2023, at 3:56 PM, Ghanshyam Mann wrote:
> ---- On Fri, 06 Jan 2023 10:41:43 -0800  Ghanshyam Mann  wrote --- 
>  >  ---- On Fri, 06 Jan 2023 05:42:45 -0800  Brian Rosmaita  wrote --- 
>  >  > Apologies for top posting, but in addition the change gmann has 
>  >  > proposed, I believe that you'll need to change your tox.ini file 
> to pin 
>  >  > tox <4.  I ran into this working on [0] yesterday, where 
> cinderclient 
>  >  > functional tests are devstack-based, and at some point during 
> devstack 
>  >  > install someone [1] pip-installs tox unconstrained.
>  >  > 
>  >  > The zuul ensure_tox role only ensures that tox is present.  The 
>  >  > ensure_tox_version var has a slightly misleading name in that it 
> is only 
>  >  > used when the role decides it needs to install tox, and then it 
> uses the 
>  >  > value of that var; it doesn't ensure that the available tox is 
> that version.
>  >  > 
>  >  > I've verified that the 'requires = tox<4' trick in [0] works when 
> the 
>  >  > tox being called is >=4 [2]; tox creates a virtualenv in 
> .tox/.tox and 
>  >  > installs tox<4 in there, and then runs your testenvs using the 
> tox you 
>  >  > required in your tox.ini.
>  > 
>  > I saw in the log that it is using the ensure-tox role from 
> devstack/playbooks/tox/run-both.yaml
>  > - 
> https://zuul.opendev.org/t/openstack/build/c957db6323dc4b42bee07f6b709fb3ad/log/job-output.txt#1182
>  > 
>  > Which is run after pre-yaml where we pinned tox<4 via  
> ensure_tox_version but missed
>  > doing it in run-both.yaml. Testing it by pinning in run-both.yaml 
> also. 
>
> Pinning in run-both.yaml playbook did not fix the python-cinderclient 
> issue and pinning tox<4 in
> tox.ini is the way forward for this case.

I don't think this is a proper fix. This goes back to the concern I already mentioned on this thread. The correct way to fix this is to ensure we aren't installing tox multiple times with the final install being the version we want. We should ensure we install it once with the correct version.

The reason the python-cinderclient change failed is that devstack is blindly installing tox here: https://opendev.org/openstack/devstack/src/branch/master/lib/neutron_plugins/ovn_agent#L369-L370 which is installing latest tox per this log: https://zuul.opendev.org/t/openstack/build/961c429cd9fc4d649e8714aba67f052d/log/job-output.txt#9211-9279.

The problem with adding requires = tox<4 in tox.ini is that this will cause tox to install a new tox in a new venv unnecessarily simply to run the target under an older tox. If we fix devstack instead then we can install tox once and everything should work.

>
> -gmann



More information about the openstack-discuss mailing list