Hi Paul, On Sun, 30 Jan 2022 16:28:54 +0800 Paul Wise <pabs@debian.org> wrote:
I noticed while packaging some Python modules recently that they were not tested by debci. This is because debci only tests source packages that contain a Testsuite field. The autodep8 tool is able to generate the needed tests, but debci only runs it when the Testsuite field is present and contains an autopkgtest-pkg-* value. The autodep8 tool also contains heuristics to detect packages that could have autopkgtests but right now there is nothing suggesting to maintainers that they should add tests based on autodep8. I suggest that when the Testsuite field is missing, lintian run autodep8 from the unpacked source package dir and when autodep8 prints a test stanza on stdout, emit a tag suggesting that the maintainer add the Testsuite field. If the Testsuite is already present, presumably the maintainer already added some tests that are better than the autodep8 ones. Since autodep8 also printswarnings/errors on stderr, lintian could also emit tags there too.Here is an example of an affected package: $ debsnap python-circuitbreaker 1.3.2-1$ chronic dpkg-source -x python-circuitbreaker_1.3.2-1.dsc $ cd python-circuitbreaker*/$ grep Testsuite debian/control $ find debian/tests find: ‘debian/tests’: No such file or directorypython-circuitbreaker-1.3.2 $ autodep8 Test-Command: set -e ; for py in $(py3versions -r 2>/dev/null) ; do cd "$AUTOPKGTEST_TMP" ; echo "Testing with $py:" ; $py -c "import circuitbreaker; print(circuitbreaker)" ; done Depends: python3-all, python3-circuitbreaker, Restrictions: allow-stderr, superficial, Features: test-name=autodep8-python3
But this is only useful if the test actually passes. We don't want people to add the field if the test is broken. So if this is implemented, make sure the priority/certainty/whatever is low enough that people will *not* just blindly do this.
Paul
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature