Autopkgtest smoke test for Python libraries
Howdy all,
I am experimenting with Autopkgtest[0] for Python library packages.
Perhaps others can use what I've made and/or make suggestions for
improvement.
The ‘python-lockfile’ Debian packaging VCS now has a smoke test suite
<URL:https://alioth.debian.org/scm/loggerhead/collab-maint/pkg-python-lockfile/trunk/files/head:/debian/tests/>.
The goal is to perform a simple “smoke test” to verify the correct
installation of the Python libraries from the Debian packages, for all
relevant Python interpreters.
A secondary goal is to have the actual smoke test code be re-usable,
possibly incorporated into a standard Debian Python packager toolkit.
* debian/tests/control
Specifies two tests to run, ‘smoke-python2’ and ‘smoke-python3’.
The dependencies explicitly specify the Python 2 and Python 3 library
modules respectively. Can this be automated better?
* debian/tests/smoke-python2, debian/tests/smoke-python3
These are Bash programs that just run a Python module under every
available Python interpreter.
Running ‘py{,3}versions -i’ gets all the installed Python
interpreters. Can this fail, e.g. can the set of interpreters be
different from what interpreters the package was built for?
These scripts are very simple, but not simple enough that I was
comfortable stuffing them directly into the ‘debian/tests/control’
file. Is that a shortcoming of the Autopkgtest specification?
* debian/tests/smoke_test.py
A module that runs a simple suite of smoke tests: emit the interpreter
description, fetch the Python distribution of the installed library
and emit that, import the modules and emit those.
Implemented as a command-line program so that the distribution name,
and the set of module names, are specified by the caller. This
hopefully makes ‘smoke_test.py’ reuseable for many Python library
packages.
Does this module meet your idea of a simple “smoke test” for Python
library packages? Should it do more?
Is there interest in getting this work into one of the Debian packaging
tookits for Python packages? How should that be done?
[0] Doesn't seem to have a coherent website or documentation index. Try
<URL:http://packaging.ubuntu.com/html/auto-pkg-test.html>.
--
\ “The Vatican is not a state.… a state must have territory. This |
`\ is a palace with gardens, about as big as an average golf |
_o__) course.” —Geoffrey Robertson, 2010-09-18 |
Ben Finney
Reply to: