Big Moose All in a Row

It the great test round up here in the Moose-Pen today

Since I have done at least two major changes in the design of Database::Accessor over the past few post I figure I better give the whole test suite the once over to see what breaks. Here are the results of the first run;


Test Summary Report
-------------------
t/11_link.t (Wstat: 65280 Tests: 4 Failed: 1)
Failed test: 4
Non-zero exit status: 255
Parse errors: Bad plan. You planned 8 tests but ran 4.
t/18_condition.t (Wstat: 65280 Tests: 2 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 7 tests but ran 2.
t/20_dad_load.t (Wstat: 65280 Tests: 50 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 53 tests but ran 50.
t/37_gathers.t (Wstat: 65280 Tests: 10 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 16 tests but ran 10.
t/43_dynamic_conditions.t (Wstat: 65280 Tests: 28 Failed: 12)
Failed tests: 17-28
Non-zero exit status: 255
Parse errors: Bad plan. You planned 16 tests but ran 28.
t/47_dynamic_gathers.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 26 tests but ran 0.
t/57_dad_elements.t (Wstat: 1024 Tests: 19 Failed: 4)
Failed tests: 13-14, 16, 19
Non-zero exit status: 4
Parse errors: Bad plan. You planned 39 tests but ran 19.
t/58_parenthes.t (Wstat: 512 Tests: 4 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 9 tests but ran 4.
Files=29, Tests=349, 50 wallclock secs ( 0.22 usr 0.11 sys + 47.25 cusr 2.30 csys = 49.88 CPU)
Result: FAIL
Failed 8/29 test programs. 17/349 subtests failed.


I expect most of the problems will be in the tests themselves and not the code but who knows. At first I as thinking of just going after the bad plan errors but I noticed that almost all of the above cases had the

Non-zero exit status: 255


on them which means the test stopped before all the scheduled tests ran. This usually means some sort of syntax or other really bad error so I guess I might as fix them in order;

The first two test cases, 11_link.t, 18_condition.t and only needed a few adjustments to the tests, resetting the input hash and removing the test for consuming the now obsolete 'Database::Accessor::Roles::PredicateArray" role, adjusting the test for the new style of singleton predicate and then finally adjusting the test count.

The next test case '37_gathers.t' was simple enough to fix I just had to remove this test


ok($dad->filter_count ==0, "No Filters on $type");

as there is no longer a “filter” attribute in Database::Accessor, and adjust the test count for it.

The next test 43_dynamic_conditions.t as well as t/20_dad_load.t only needed a count adjustment so they where an easy fix.

The next test case '47_dynamic_gathers.t' will have to be fully resigned as the new 'gather' and 'dynamic_gather' attributes are very much different that the older way I was doing things. So I will set this one aside for now.

The test case '57_dad_elements.t' which was the last one I was working on before I made the change to 'Links' and 'conditions' still has some more tests to add but I did fix one bug in the tests and corrected the test count. After this I am still getting two fails on this test;


...
not ok 16 - Fourth condition left->left inherits view

not ok 19 - Fourth condition left->right->left->right inherit view

both of these are a problem with my iteration in the '_parentheses_check' sub I am not getting into the view deep down a nested predicate as the test 16 is looking for this;

'right' => bless( {
'name' => 'bonus',
'view'=> 'People'
}, 'Database::Accessor::Element' ),

but getting this;

'right' => bless( {
'name' => 'bonus',
'view'=> 'People'
}, 'Database::Accessor::Element' ),

As I have yet to finish this test I will circle back later and get a fix in for it.

Finally there is '58_parenthes.t' with a few needed changes to the input hash I got a few more of the tests to run but then I ran into


Can't locate object method "add_filter" via package "Database::Accessor" at 58_parenthes.t line 288.


which is of course gone now but I think is is something I will have to add in to keep the API up to snuff.

In the then the result I got all the test cases passing except for 47_dynamic_gathers.t, which has to be rewritten, t/57_dad_elements.t that is not complete and still is indicating a bug in Accessor and finally 58_parenthes.t which I think has to be rewritten and also indicates a hole in Database::Accessors API.

Not bad considering the changes I have made over the past few days.

sw84-37.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