Moose-Pen is Back

Moose-Pen is Back

Sorry I missed a few days it seem that when you have walking pneumonia it can turn into creeping pneumonia very easily. Who knew? I will have to start my year of daily posts again I guess I should be satisfied with 297 consecutive days.

Just a postette for for today and as usual it is just a quick all-up test post. For Database::Accessor it has been a while since I did a full pull on the repo and I got


6 files changed, 160 insertions(+), 39 deletions(-)

So maybe expecting a few problems there and on my first run I get

t/50_create.t (Wstat: 65280 Tests: 6 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 9 tests but ran 6.
t/54_update.t (Wstat: 512 Tests: 8 Failed: 0)
Non-zero exit status: 2
Files=29, Tests=503, 80 wallclock secs ( 0.24 usr 0.05 sys + 77.03 cusr 1.59 csys = 78.91 CPU)
Result: FAIL
Failed 2/29 test programs. 0/503 subtests failed.

And a few;

Use of uninitialized value in string eq at .../lib/Database/Accessor.pm line 85.

warnings. I will get rid of that warning first

This one truned out to be a real nasty one but in the end I got it


       sub get_element_by_name {
           my $self = shift;
           my ($name) = @_;
--           my $found = $self->_get_element_by_name(sub {$_->name eq $name});
++           my $found = $self->_get_element_by_name(sub { if (!defined($_->name)) {return 0} $_->name eq $name});
           return $found;
       }

I had to make sure the $_->name was defined as well. Onto the other bugs

t/50_create.t .. 1/9 Not a HASH reference at t/lib/Database/Accessor/Driver/Test.pm line 13.

so I had a look in there and this one points to a deeper problem;


 my ($result, $type, $conn, $container, $opt ) = @_;
    my $processed_container = {dad_fiddle=>1};
    foreach my $key (keys(%{$container})){
        $processed_container->{$key} = $container->{$key};
    }
    $result->processed_container($processed_container);
that $container I am passing in could be an array-ref or I think even a class. So I will skip that one for tomorrow when my brain is a little less foggy and look at the next one

t/54_update.t    

Can't locate object method "in_container" via package
"Database::Accessor" at 54_update.t line 114.


and that is just a simple oversight on the test

-- my $in_container = $da->in_container();
++ my $in_container = $da->result()->in_container();

and I needed to update the test count as well;

use Test::More tests => 8;
use Test::More tests => 9;

Like I said I will leave that 50_create.t test till tomorrow. Now onto Driver::DBI

Now I have to be a little careful here as I can't run the XT tests on this particular box as it has no DB deployed on it yet but I still have these files


lib/Database/Accessor/Driver/DBI.pm | 6 +--
t/00_load.t | 3 +-
t/40_joins.t | 1 +
t/lib/Test/User,pm | 13 -------

opps my t/15_alias.t tests case had 6 fails. Hopefully it is jus the test that has to be changed

Looking at the test resultes they are all for update statements and look like this;


# Expected SQL--> UPDATE people SET first_name = ?
# Generated SQL-> UPDATE people SET

It looks like the alias part is now not working as expected.

Oh well a post for Firday as my brain is much too soft for any thinking right now.

sickmoose01.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations