Fwd: how to detect that we"re running under CPAN::Testers?
am 12.01.2006 01:52:24 von TylerRon Savage suggested that the ideal way to handle the "end user vs.
autotester" scenario was to encourage the autotesters to install
DBD::SQLite2 (or perhaps set a valid DBI_DSN) for the testing.
testers.cpan.org's existant autotest system doesn't seem to have a way to
tell them this beyond an actual dependancy, neither does
ppm.activestate.com. Even worse (well better from a QA point of view i
guess), ppm.activestate.com won't generate a .ppd for a package with failing
tests; an ActivePerl user can only "ppm install" packages whose tests all
pass.
As a start to solve/workaround this problem, I've sent the following
email to perl-qa@perl.org with the hope that there is a real solution in
place (or at least, somebody's had to deal with this before):
----- Forwarded message from Tyler MacDonald
=46rom: Tyler MacDonald
Subject: how to detect that we're running under CPAN::Testers?
To: perl-qa@perl.org
Hello,
Is there any way to tell if my package is being tested automatically
under CPAN::Testers? Here's the situation:
I have a DBI extension (DBIx::Transaction) whose unit tests
currently depend on a valid DSN being available. SQLite makes a good testbed
for "mock" databases, so if DBD::SQLite2 is available, my module defaults to
testing against a temporary database using that. Thus, DBIx-Transaction-0.04
depends on DBD::SQLite2 *unless* the DBI_DSN environment variable is set to
a non-SQLite2 driver. If DBI_DSN is set to an empty string, the tests do not
run at all.
Some people think that in a perfect world, end users should not be
made to install DBD::SQLite2 by default. I'm leaning towards that as well;
less bloat is good.
However, when these packages are being auto-tested as part of the
perl QA effort (and possibly for packaging for use in ActivePerl on
ppm.activestate.com as well), I'd like my Makefile.PL to notice this and
depend on DBD::SQLite2 after all, so that the tests will be run and we have
an assurance that the package works.
Any thoughts/ideas?
Thanks,
Tyler
----- End forwarded message -----