Thanks for the advice that best practice is to use cpan in the first
instance instead of ppm: I'll do that in future.
"Having tests that verify that the necessary modules were indeed loaded is
rather superfluous"
I agree loading the dependencies is redundant. I meant something like
use_ok('DBIx::Class::Exception'), as distinct from duck-testing (if you
know what I mean) the functionality of the module.
Daniel
From: "Peter Rabbitson via RT" <bug-DBIx-Class@rt.cpan.org>
To: dperrett@cambridge.org
Date: 15/02/2013 12:15
Subject: Re: [rt.cpan.org #83340] Test that DBIC Modules Load
<URL:
https://rt.cpan.org/Ticket/Display.html?id=83340 >
On Fri, Feb 15, 2013 at 06:55:12AM -0500, Daniel Perrett via RT wrote:
Show quoted text> Fri Feb 15 06:55:08 2013: Request 83340 was acted upon.
> Transaction: Ticket created by dperrett@cambridge.org
> Queue: DBIx-Class
> Subject: Test that DBIC Modules Load
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: dperrett@cambridge.org
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=83340 >
>
>
> BACKGROUND
>
> I installed DBIx::Class 0.08123 on Strawberry perl 5.12.3 using ppm (OS:
Show quoted text> XP Pro). The install was successful, but, while trying to run a minimal
> app (attached), DBIx::Class failed with this message:
>
> Can't locate Carp/Clan.pm in @INC (@INC contains: AudioDB/lib
> ...
>
>
> However, oddly, I also couldn't find any tests that guaranteed all the
> classes could be loaded ok, but the test suite is pretty big, so
possibly
Show quoted text> I missed them. Nevertheless, clearly 0.8123 passed on a lot of machines,
Show quoted text> and where it failed, didn't necessarily say anything about Carp::Clan.
>
> Should such a test be included, if it is not already?
>
Not really. DBIx::Class 0.08123 clearly indicates it requires Carp::Clan
[1]. Having tests that verify that the necessary modules were indeed
loaded is rather superfluous, because the impact of a broken toolchain
is immediately apparent (as you saw). All in all whoever built the ppm
screwed up royally, and it was not immediately apparent to you because
ppm installs do not execute any tests. This is why it is always
preferred to use the CPAN toolchain (cpan/cpanm/cpanp) as opposed to ppm.
I will wait for you to confirm the above fully answers your question
before closing this ticket.
Cheers
[1]
https://metacpan.org/source/FREW/DBIx-Class-0.08123/META.yml#L34