[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python related autopkgtest anti-pattern



On Wed, 18 Mar 2020 at 18:32:22 -0400, Scott Kitterman wrote:
> We want the tests to run against all versions, but the way to do that is to 
> have your test depend on python3-all (to make sure that all supported versions 
> are installed) and then use the -s flag for py3versions vice -i.  So (in one 
> common pattern) this:
> 
> for py in $(py3versions -i); do
> 
> changes to:
> 
> for py in $(py3versions -s); do

I think part of the problem here is that py3versions -i treats
python3.*-minimal as being "installed". Could it perhaps not do
that? It is true that they are installed in the sense that there is a
/usr/bin/python3.*, but it isn't a complete, functional version of Python
(most of the standard library is missing), so many tests are going to
fail in it.

Normally, python3.*-minimal would be installed if and only if python3.*
is, but the qemu backend for the autopkgtest framework requires either
python3-minimal or python-minimal installed in the VM (to run a small
Python program to transfer data between the container and the host), so
the autopkgtest setup script installs python3-minimal, and autopkgtest
containers will typically have python3-minimal installed (even those
that are nothing to do with the qemu backend). When testing has an older
default version of python than unstable, for example 3.7 and 3.8 right
now, that will result in python3.7-minimal remaining installed after
python3{,-minimal} gets upgraded to 3.8.

Perhaps autopkgtest should be using python3 instead of python3-minimal,
although that would make it impossible for an autopkgtest to detect a
missing dependency on python3.

    smcv


Reply to: