• Correct command to skip multiple tests in autopkgtest?

    From Soren Stoutner@21:1/5 to Debian Python Team on Fri Nov 1 16:03:45 2024
    I am in the process of packaging pyinstaller.

    https://pypi.org/project/pyinstaller/

    Many of pyinstaller’s tests require the pyinstaller-hooks-contrib package, which I am also in the process of packaging.

    https://pypi.org/project/pyinstaller-hooks-contrib/

    But pyinstaller-hooks-contrib depends on pyinstaller for its tests.

    In order to bootstrap the introduction of these packages into Debian, I am temporarily disabling the pyinstaller tests that depend on pyinstaller-hooks- contrib using the following command in debian/rules:

    export PYBUILD_TEST_ARGS=-k\
    'not test_find_module\
    and not test_metadata_searching\
    and not test_Qt_QTranslate\
    and not test_zeep\
    and not test_scapy3\
    and not test_zope_interface\
    and not test_gevent\
    and not test_user_preferred_locale\
    and not test_pytz'

    This works successfully during the build process:

    1004 passed, 286 skipped, 25 deselected, 24 xfailed, 1 xpassed, 17 warnings in 6969.97s (1:56:09)

    https://salsa.debian.org/soren/python-pyinstaller/-/jobs/6514811#L6635

    But, for some reason, autopkgtest doesn’t like the format of the arguments.

    I: pybuild base:311: cd /tmp/autopkgtest-lxc.ntf_swjm/downtmp/autopkgtest_tmp/ build; python3.12 -m pytest -k 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz'
    usage: __main__.py [-h] [--link-only] {samedir,subdir,parentdir}
    __main__.py: error: argument test_type: invalid choice: 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz' (choose from 'samedir', 'subdir', ‘parentdir’)

    https://salsa.debian.org/soren/python-pyinstaller/-/jobs/6514819#L781

    I have tried several syntax variations without success. Does anyone know the correct syntax for skipping several tests in autopgktest?

    --
    Soren Stoutner
    [email protected]
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmclXlEACgkQwufLJ66w tgOcCQ/7B5e1il4qQGW6yDRJtUrpBiUtcPv+yaEg9hMckRNTFFgKOzvHCh4vDgF1 p1dy7bLIh8lrcVxw82vFa0R7+UzfFpuiDGTL1yHVLFiC6McqNBhROnH+/qfKyw9P LT8wej1qafB8ZuyL8JFoOI9fNsZvtFltEDbMQXzOv67XuOCcG+MvZtbqvEELDrYb HwgZE6zKGVhPunu2MqekBjHHVKGE5kViRdQjrKTCe9T1ib2qFfZFt82f3bklg/+e lxLaTi3M4lzQy8BW6auQGG0tXYhX4uHjJF52F8bAaMoVb80RBP1KlkEZmUKbet6T tNemxjNnw7l+MBmFGTMF7cXfXoUJ6FO7XCfAljIw7o8GvOr8SKujlF03BOjgr1kt 3dLBybf1G0Te2wfsUk3g/smeeACQhCKtN21Wa0P8xs5RkyZ2QXGl8Yu/UbUH4t1R GZUA7QtJvsMZhTXIcg6C/dmxKEcxFP0/v3e9ldj3nSuB5gVmGOVAKudTDKqSefFg qk+hc35CdRepmSZakwDiJ/YqpfUYfwEpTOj0QzHi1TUiIlUAgc0rr+pLSLvnRq2K TvyY1w7ju+edZbCwV3QgUdSFrzjnIaIqZVcUqt7I10/PW+ZT3SnZBXMZbDkeMNId ASUhinQW+YXlR8cBG4oymdMQ/1/uMhYA6HJ60SnzzuePIU6EmUY=
    =U0Ii
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julian Gilbey@21:1/5 to Soren Stoutner on Mon Nov 11 21:20:01 2024
    On Wed, Nov 06, 2024 at 02:29:34PM -0700, Soren Stoutner wrote:
    On Friday, November 1, 2024 4:03:45 PM MST Soren Stoutner wrote:
    I: pybuild base:311: cd /tmp/autopkgtest-lxc.ntf_swjm/downtmp/
    autopkgtest_tmp/
    build; python3.12 -m pytest -k 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not
    test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz'
    usage: __main__.py [-h] [--link-only] {samedir,subdir,parentdir} __main__.py: error: argument test_type: invalid choice: 'not test_find_module
    and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep
    and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz' (choose from 'samedir', 'subdir', ‘parentdir’)

    My experience with another package is that -k works correctly with autopkgtest
    when skipping only one test. The problem appears to be something related to parsing multiple tests to skip. I have tried a couple of syntax variations, but so far haven’t been able to guess the right one.

    You could have a look at what I've done in pydevd (soon to be removed
    from the archive), which was a complex case. But I'd suggest using
    the syntax

    --deselect=tests/test_file.py::test_testname

    instead of -k; it can be given multiple times, and as long as there
    are no spaces or weird characters in the test names (for example, tests/test_file.py::test_testname[this is a parameter]), it works fine
    when stored as a shell variable and then expanded without quotes.

    Best wishes,

    Julian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Soren Stoutner@21:1/5 to Debian Python Team on Wed Nov 6 14:29:34 2024
    On Friday, November 1, 2024 4:03:45 PM MST Soren Stoutner wrote:
    I: pybuild base:311: cd /tmp/autopkgtest-lxc.ntf_swjm/downtmp/
    autopkgtest_tmp/
    build; python3.12 -m pytest -k 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz'
    usage: __main__.py [-h] [--link-only] {samedir,subdir,parentdir}
    __main__.py: error: argument test_type: invalid choice: 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz' (choose from 'samedir', 'subdir', ‘parentdir’)

    My experience with another package is that -k works correctly with autopkgtest when skipping only one test. The problem appears to be something related to parsing multiple tests to skip. I have tried a couple of syntax variations, but so far haven’t been able to guess the right one.

    --
    Soren Stoutner
    [email protected]
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmcr374ACgkQwufLJ66w tgPORw//XT0EuLRhDnZz77qPBsYOLv8+WRbj1If6i4iL6dqi30TERBfnYoUr5xPZ Kw9WkMQxQp68jcPdXFfF6d3AQZfsUNPswxkt8usNobX0vkJzkAXMaYKxkjGJwy1G 77ISq33vm5tlYbhGVckpbsh3v4foAqA7PZvSw+G7AtkQAY9Qvx1hkpStRw1/M/E7 Nf27KpWaQFxt03EVXp6tS4f7+wE0TmCsZRlnvlSetc0ToKQv2E7r70PRPEpUmOYF tGCwrac2qj7+MGE3ojYYPc08NoO3IVcihLCFaMGrezElnOVor2dNUaydwGDFRvvH GChdOHEK2Wkg5BVCCTXPQKCLF8gOeH8TPuvVju5xgiVr43zz4IzPE206fn+x1ZXH ndzMqWH1ZUqbUq4G8w1j9JzKQCSIJmKl1et9vjFGtKCuZ+JNemaTe6AgW/I+TL9B n7XbvNo2pO5UIiVQFuJOYnIqDk3zQZMHiNVINrbFR88JT0yf3JhIsNagOcWmM+Er lU+mfgIVyDLAm8i6y/Lw2oBiYSXnoB+fjyk4juozDoMqkYPN5kGbgBrqX+TjKsFA x2a6W/iRWweA+IXEKkhvlGuF5Advj0JMmA2nICXpZAdYcEgBpgMqQqFp3lQtxsSn eqm33baiJqK4OFh6YCiEquKzv2wv3DqslhpGL9lrSd6odSINKB4=
    =KbOB
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Soren Stoutner@21:1/5 to Debian Python Team on Tue Nov 12 11:01:35 2024
    On Monday, November 11, 2024 1:18:12 PM MST Julian Gilbey wrote:
    You could have a look at what I've done in pydevd (soon to be removed
    from the archive), which was a complex case. But I'd suggest using
    the syntax

    --deselect=tests/test_file.py::test_testname

    instead of -k; it can be given multiple times, and as long as there
    are no spaces or weird characters in the test names (for example, tests/test_file.py::test_testname[this is a parameter]), it works fine
    when stored as a shell variable and then expanded without quotes.

    Thanks for the suggestion, but I wasn’t able to get --deselect to work, either
    during the build or in autopkgtest. I also have been unsuccessful in getting --ignore or -k to work with autopkgtest, even though they both work during the build.

    My sense is that it is some bug related to the implementation of "Testsuite: autopkgtest-pkg-pybuild”, but I don’t know enough about it to troubleshoot it.

    --
    Soren Stoutner
    [email protected]
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmczl/8ACgkQwufLJ66w tgOJGhAAqyDH4ycPceEWbSU1bBwXUenxSb4O3+P3hWLeiEpbVjNNPCGAPx7B0DMK m12MJN8NQj+ncgRQv36RJjQX0Ld1qU+8+2bH5pnryW9U04Bkf8PQWW0WOiS8sFPD vYyQQIF1Dy4Amz85YXUl5YzZaXATiPda4D1RA+f82ps5PeT+peAhXVrpdfOPcJHN jWlgd/KJLIqrL9foh0z2E8xIMZemI8SdQfnMDqTsj/Gp0G8Equs9Or88ZFHBsKWK Ws676WgAXxSuu+UgtOHq7e3c2XIjwO3wkpeZVtjHUUpN28IeOgpC+yC4qI93MJTA m2VmQRpY16JcQ3HCqdeC1SiYIoklsW7aew+nkMpw/PnVfl2/LVeyTJLWtZW17deN w0p9m//32TKpp1+N/PHT6IWAMlbX4s3ssvY0yphLDEaVVPnEkVtWX2ObkwALyucT 4uRQwZbRo/GKEyEegC1b0mr2alvApS/rj9G3oqddt+/82WC42d397OX3vDBxxgoa QitrH20uQyKbxZTvg+v0EI8ubCaCqCJrkBIYofx/6G1Y4q8C9bSoK3MfK38wMxZG V3nCsegYXHB/knHS74o5t8h8cLcgn2yvblZfTPHPPBD4LjbNUa+vgO9fi4JUnt8c eUolYMg84QmIEQrE3pbDONy7u9FCP8ER41rqxs3GO+/WyjPhjE0=
    =LCn3
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Soren Stoutner@21:1/5 to Debian Python Team on Mon Dec 2 17:24:37 2024
    On Friday, November 1, 2024 4:03:45 PM MST Soren Stoutner wrote:
    I am in the process of packaging pyinstaller.

    https://pypi.org/project/pyinstaller/

    Many of pyinstaller’s tests require the pyinstaller-hooks-contrib package, which I am also in the process of packaging.

    https://pypi.org/project/pyinstaller-hooks-contrib/

    But pyinstaller-hooks-contrib depends on pyinstaller for its tests.

    In order to bootstrap the introduction of these packages into Debian, I am temporarily disabling the pyinstaller tests that depend on pyinstaller-
    hooks-
    contrib using the following command in debian/rules:

    export PYBUILD_TEST_ARGS=-k\
    'not test_find_module\
    and not test_metadata_searching\
    and not test_Qt_QTranslate\
    and not test_zeep\
    and not test_scapy3\
    and not test_zope_interface\
    and not test_gevent\
    and not test_user_preferred_locale\
    and not test_pytz'

    This works successfully during the build process:

    1004 passed, 286 skipped, 25 deselected, 24 xfailed, 1 xpassed, 17 warnings
    in
    6969.97s (1:56:09)

    https://salsa.debian.org/soren/python-pyinstaller/-/jobs/6514811#L6635

    But, for some reason, autopkgtest doesn’t like the format of the arguments.

    I: pybuild base:311: cd /tmp/autopkgtest-lxc.ntf_swjm/downtmp/
    autopkgtest_tmp/
    build; python3.12 -m pytest -k 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz'
    usage: __main__.py [-h] [--link-only] {samedir,subdir,parentdir}
    __main__.py: error: argument test_type: invalid choice: 'not test_find_module and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not test_scapy3 and not test_zope_interface and not test_gevent and not test_user_preferred_locale and not test_pytz' (choose from 'samedir', 'subdir', ‘parentdir’)

    https://salsa.debian.org/soren/python-pyinstaller/-/jobs/6514819#L781

    I have tried several syntax variations without success. Does anyone know
    the
    correct syntax for skipping several tests in autopgktest?

    In the case of PyInstaller, the answer ended up being to not use `Testsuite: autopkgtest-pkg-pybuild` and instead call the tests manually using debian/ tests/control.

    https://salsa.debian.org/soren/python-pyinstaller/-/blob/main/debian/tests/ control?ref_type=heads

    Although there are some further errors to investigate, this at least allowed the tests to run.

    https://salsa.debian.org/soren/python-pyinstaller/-/pipelines/772011

    I am uncertain why `Testsuite: autopkgtest-pkg-pybuild` was failing, but it may relate in some way to the fact that PyInstaller has so many tests that they are all organized into subdirectories. Perhaps not having any tests directly in `tests` was an issue. At least, that is one possible meaning of the `choose from 'samedir', 'subdir', ‘parentdir’)` in the error message.

    https://github.com/pyinstaller/pyinstaller/tree/develop/tests

    --
    Soren Stoutner
    [email protected]
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmdOT8UACgkQwufLJ66w tgNdxxAAuYktVE7lGTxBgbNI0DrVmbjfnH377EHEYawlqm8WH0t3jPlqw+NqnstY cIJDlkCY6dL36YjSPLhr1YFJB+UnTBJYCpyKZqqJkAYiFMOnZhgnCU13Yo2ymGv8 Y0blW6r47wIm+9nhdJCViSX0D/lXZlP7UQ7IfmG/9asD7MrybnZlOYp4vhvHVW3o awZ03afojg9AyVfc2NaeRV7TvdUYOWTn9o0BRLRzJeB0Oj3B/QRA9us0U7H3KB5n Hq/0wxNuJ7pWS4lkJ1Fa5kHw9GzaZrLSljkFZkmQCr6jAUjXmNKH3Vy6NWWIj+J9 GUA4cYr0+gpTePOwRELCO+/XsmU+blIGvguElTGts6Nb0mxRH1CYwjnBTMIIOw6q sWXIQkw5GE13URPavRpqM0GkxhsieuYMq7xty1eCCSnC5JAkcorCpbkvFlsXxBmN 5LFBLPpFe0qMHSJyIqg5clNNwb2+zbiPp7b5qTKgYEPRUGMq5bwL/Zwj0N9FhzNj 7WD6DjkuWTUIQyhFcef/dMLCJy4qFjLxCjbYl8TS16X7xdp9f2JTBPqT0g5elJs8 gzwX2IF9FqDwyn9j0waF0gNSHjW70MC1t3lPdJIjw5JDwAjfk/bwDLHupMmSWDOS 6CjtCVnw3E6NDUqguJ0w1S30yGcTmaaCCOudT7p+1h0jqwosBQ0=
    =rZCY
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)