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

Re: package testing, autopkgtest, and all that



On Thu, Jan 27, 2011 at 02:46:40PM +0000, Ian Jackson wrote:
> >  * A specification which allows a source package to declare that it
> >    contains tests, and how those tests need to be run.  This
> >    specification was discussed extensively on debian-devel at the
> >    time and a copy is in the autopkgtest package, but I'll follow up
> >    this email with a copy of it.
> 
> Here it is.

Thanks. I report below a few questions/comments, essentially about
unclear wording (to me).

> The tests will be performed by executing debian/tests/fred,
> debian/tests/bill, etc.
<snip>
> The cwd of each test is guaranteed to be the root of the source
> package which will have been built.  HOWEVER note that the tests must
> test the INSTALLED version of the program.  Tests may not modify the
> source tree (and may not have write access to it).

I find "INSTALLED version of the program" to be ambiguous. It might
refer to installed in the sense of 'debian/rules install' (or, to be
more precise, 'debian/rules binary', given that 'install' is not
dictated by policy). In that case the tests will use executables
available under debian/tmp/* or the like.

Alternatively, it might refer to the currently installed *package*. In
that case the tests will use executables installed along their $PATH.

The latter case needs some setup magic to install the just built
package, but is more convenient for many software rely on hard-coded
paths and do not permit to override them at runtime. The former case as
converse pro/cons.

I cannot look at the code right now to check which is the case as I'm
offline, but the text should probably be unambiguous in that respect
anyhow.

>   Depends: <dpkg dependcy field syntax>
> 
>     Declares that the specified packages must be installed for the
>     test to go ahead.  `@' stands for the package(s) generated by the
>     source package containing the tests; each dependency (strictly,
>     or-clause, which may contain `|'s but not commas) containing `@'
>     is replicated once for each such binary package, with the binary
>     package name substituted for each `@' (but normally `@' should
>     occur only once and without a version restriction).

From this text alone, it's not clear to me how this work with source
packages which generate multiple binary packages. Are all binary
packages AND-ed together as a single dependency for the test?

Given that large source packages can easily generate non-co-installable
binary packages, in those cases the maintainer should cherry pick the
specific dependencies test-by-test, am I reading it right?

>     If no Depends field is present, `Depends: @' is assumed.  Note
>     that the source tree's Build-Dependencies are _not_ necessarily
>     installed, and if you specify any Depends, no binary packages from
>     the source are installed unless explicitly requested.

So, to specify no test dependencies at all, "Depends: " is the way to
go, right? (In one of the two scenarios I've described in the beginning
this is a completely useless corner-case scenario, while in the other it
is not).

Cheers.

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Quando anche i santi ti voltano le spalle, |  .  |. I've fans everywhere
ti resta John Fante -- V. Capossela .......| ..: |.......... -- C. Adams

Attachment: signature.asc
Description: Digital signature


Reply to: