#755442 Running tests at build time

#755442#5
Date:
2014-07-20 21:25:03 UTC
From:
To:
Hi Mathieu,

Le 09/02/2014 03:41, Mathieu Parent a écrit :

Now that we have about twenty packages that recently added their test
suite at build time, it looks like the usage is that upstream drops a
phpunit.xml.dist file at the root, and we then add the following into
debian/rules:

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
        phpunit
else
        @echo "** tests disabled"
endif


The second alternative usage is that upstream drops a tests/phpunit.xml
file, and we then add the following into debian/rules:

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
        cd tests && phpunit
else
        @echo "** tests disabled"
endif


I didn’t yet come across many PEAR packages with a proper phpunit
testsuite, but it looks like the usage is similar (with phpunit.xml.dist
or tests/phpunit.xml dropped in the PEARName-Version directory instead
of the root one, and thus an additional “cd PEARName-Version” in
debian/rules).

Some tests suite can run with phpunit even if no phpunit.xml{,.dist}
file is provided, but checking it existence as an heuristic looks like a
fair first step before we have a better idea of how to handle them.


Even if it usually needs additional patches to actually run the test
suite, providing those default dh_auto_test rules by pkg-php-tools
should be an improvement. I’d be happy to help fixing any packge that
will FTBFS if such a change were added soon enough before the freeze.


Regards

David

#755442#10
Date:
2014-07-21 07:41:27 UTC
From:
To:
2014-07-20 23:25 GMT+02:00 David Prévot <david@tilapin.org>:
[...]
may require installation of dependencies not needed at build time.

But: as most php packages are self-contained, let's go with opt-out.

[dep8]: http://dep.debian.net/deps/dep8/

I agree.

OK. If you have time to do the following, please go ahead!
- provide a patch
- build all packages again and check FTBFS
- report summary here
- (eventually) MBF (mass-bug filing)
- apply patch and upload