Subject: | t/73oracle_inflate.t failed at END clauses |
In my circumstance (with Perl-5.8.8, Test::Harness 3.05, Test::More 0.74
, CPAN 1.9205 on CentOS 5), test script t/73oracle_inflate.t complains
of failure, as follows.
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(1, 'inc', 'blib/lib', 'blib/arch')" t/73oracle_inflate.t
t/73oracle_inflate......
1..0 # Skip needs DateTime and DateTime::Format::Oracle for testing
Can't call method "class" on an undefined value at t/73oracle_inflate.t
line 59.
END failed--call queue aborted.
skipped: needs DateTime and DateTime::Format::Oracle for testing
Test Summary Report
-------------------
t/73oracle_inflate.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
All of CPAN tester reports indicated that message.
Most of test reports ignored that status, but some of reports showed
failure (as I'm reporting).
http://cpantesters.perl.org/show/DBIx-Class.html#DBIx-Class-0.08008
I don't realize why only some testers report this failure.
But the cause of that warnings is clear. In END { ... } block, $schema
variable is used as if it would be initialized even if we skip the
entire test.
Following patch might work and seems to be harmless.
--- t/73oracle_inflate.t.orig 2007-09-05 03:33:10.000000000 +0900
+++ t/73oracle_inflate.t 2007-12-17 11:59:13.000000000 +0900
@@ -55,7 +55,9 @@
# clean up our mess
END {
# Set the metadata back for the last_updated_on column
- $schema->class('Track')->add_column( 'last_updated_on' =>
$col_metadata );
+ if($schema) {
+ $schema->class('Track')->add_column( 'last_updated_on' =>
$col_metadata );
+ }
if($dbh) {
$dbh->do("DROP TABLE track");
Regards.