[pkg-php-pear] tests in composer packages (was: Re: ITP: php-symfony-process -- Symfony PHP Framework - Process component)

Mathieu Parent math.parent at gmail.com
Sun Jun 30 15:04:51 UTC 2013

2013/6/28 andrea rota <a at xelera.eu>:
> On Fri, Jun 28, 2013 at 01:49:48PM +0800, Thomas Goirand wrote:
> [...]
>> Last, something I didn't see at first: there's a Tests folder, which is
>> meant to be used with phpunit. If possible, it'd be nice to launch the
>> unit testings at build time. This might need phpunit 3.7, in which case
>> we should work on it (Parch: what's the status with that?).
> from a couple of composer-only (i.e. no PEAR distribution available from
> upstream) packages i'm working on, phpunit=3.6.10-1 works fine as far as
> i can tell. however, running phpunit in the build folder just shows a
> message asking to install (via composer) the dependencies of the code
> being tested/packaged: this could either be achieved via a system-wide
> composer install (on which i'm working), but i'm not sure whether
> phpunit should rely on system-wide library installs (i.e. packaged in
> Debian) or if it would be best to let the system-wide composer binary
> work as a per-project installer, creating a 'vendor' folder in the build
> directory, downloading the required dependencies and installing them in
> 'vendor', creating the autoloader code - again, in 'vendor' - and
> running tests there.
> an alternative (not sure how kosher) would be to add a precompiled
> composer.phar binary to pkg-php-tools, to be used just for tests so that
> everything is self-contained at build time and doesn't depend on any
> Debian package of PHP libraries.
> i think either way has pros and cons depending on use cases. anyway,
> it's early times for this since i need to get composer to work as
> system-wide install first, but wanted to flag this up in the meanwhile.

A build should not contact internet in any way. So the solution here
is to add all the libraries needed for the tests as build-dependencies
(and they should be packaged first).


More information about the pkg-php-pear mailing list