Two tests are failing with DBD::mysql 4.041 prove t/db_dependent/Accounts.t t/db_dependent/Bookseller.t t/db_dependent/Accounts.t .... 17/23 # Failed test 'Correct amount logged to statistics' # at t/db_dependent/Accounts.t line 398. # got: '100' # expected: '100.0000' # Looks like you failed 1 test of 8. t/db_dependent/Accounts.t .... 20/23 # Failed test 'More Koha::Account::pay tests' # at t/db_dependent/Accounts.t line 400. # Failed test 'Correct amount logged to statistics' # at t/db_dependent/Accounts.t line 452. # got: '60' # expected: '60.0000' # Looks like you failed 1 test of 8. t/db_dependent/Accounts.t .... 21/23 # Failed test 'Even more Koha::Account::pay tests' # at t/db_dependent/Accounts.t line 454. t/db_dependent/Accounts.t .... 23/23 # Looks like you failed 2 tests of 23. t/db_dependent/Accounts.t .... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/23 subtests t/db_dependent/Bookseller.t .. 2/86 # Failed test 'Koha::Acquisition::Booksellers->search returns the right informations about supplier Name2' # at t/db_dependent/Bookseller.t line 120. # Structures begin differing at: # $got->{discount} = '2' # $expected->{discount} = '2.0000' # Failed test 'Returns right fields of Supplier1 and Supplier2' # at t/db_dependent/Bookseller.t line 133. # Structures begin differing at: # $got->[0]{discount} = '2' # $expected->[0]{discount} = '2.0000' # Failed test 'Get Supplier1 (find a bookseller by id)' # at t/db_dependent/Bookseller.t line 152. # Structures begin differing at: # $got->{discount} = '1' # $expected->{discount} = '1.0000' # Looks like you failed 3 tests of 86. t/db_dependent/Bookseller.t .. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/86 subtests Test Summary Report ------------------- t/db_dependent/Accounts.t (Wstat: 512 Tests: 23 Failed: 2) Failed tests: 20-21 Non-zero exit status: 2 t/db_dependent/Bookseller.t (Wstat: 768 Tests: 86 Failed: 3) Failed tests: 9, 11, 15 Non-zero exit status: 3 Files=2, Tests=109, 12 wallclock secs ( 0.05 usr 0.01 sys + 4.63 cusr 0.75 csys = 5.44 CPU) Result: FAIL Tests pass with DBD::mysql 4.028
Created attachment 71388 [details] [review] Bug 20169: Fix two tests when DBD::mysql is 4.041 Tests pass with DBD::mysql 4.028, but not with 4.041. I'm not sure which exact version makes those tests to fail. The problem is that with newer versions of DBD::mysql, 'float' columns get converted to numbers instead of string, thus the comparison fail. This patch converts the expected values to numbers so the comparison should succeed with both versions of DBD::mysql Test plan: 1. Install DBD::mysql 4.041 or newer 2. prove t/db_dependent/Accounts.t t/db_dependent/Bookseller.t
Created attachment 71595 [details] [review] Bug 20169: Fix two tests when DBD::mysql is 4.041 Tests pass with DBD::mysql 4.028, but not with 4.041. I'm not sure which exact version makes those tests to fail. The problem is that with newer versions of DBD::mysql, 'float' columns get converted to numbers instead of string, thus the comparison fail. This patch converts the expected values to numbers so the comparison should succeed with both versions of DBD::mysql Test plan: 1. Install DBD::mysql 4.041 or newer 2. prove t/db_dependent/Accounts.t t/db_dependent/Bookseller.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
So does this raise the required version? Updated tests fail for DBD::mysql 4.028
(In reply to Nick Clemens from comment #3) > So does this raise the required version? Updated tests fail for DBD::mysql > 4.028 No tests should pass with 4.028 too. What is the output of tests ?
not ok 9 - Koha::Acquisition::Booksellers->search returns the right informations about supplier Name2 # Failed test 'Koha::Acquisition::Booksellers->search returns the right informations about supplier Name2' # at t/db_dependent/Bookseller.t line 121. # Structures begin differing at: # $got->{discount} = '2.0000' # $expected->{discount} = '2' ok 10 - Get Supplier1 and Supplier2 not ok 11 - Returns right fields of Supplier1 and Supplier2 # Failed test 'Returns right fields of Supplier1 and Supplier2' # at t/db_dependent/Bookseller.t line 134. # Structures begin differing at: # $got->[0]{discount} = '2.0000' # $expected->[0]{discount} = '2' ok 12 - Supplier1 has 0 basket ok 13 - Supplier1 has 2 baskets ok 14 - find returns undef if no id given not ok 15 - Get Supplier1 (find a bookseller by id) # Failed test 'Get Supplier1 (find a bookseller by id)' # at t/db_dependent/Bookseller.t line 153. # Structures begin differing at: # $got->{discount} = '1.0000' # $expected->{discount} = '1'
Marking Failed QA for now (comment#5) Tested with kohadevbox and 4.028 Bookseller.t fails for me too: kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/Bookseller.t t/db_dependent/Bookseller.t .. 1/86 # Failed test 'Koha::Acquisition::Booksellers->search returns the right informations about supplier Name2' # at t/db_dependent/Bookseller.t line 121. # Structures begin differing at: # $got->{discount} = '2.0000' # $expected->{discount} = '2' # Failed test 'Returns right fields of Supplier1 and Supplier2' # at t/db_dependent/Bookseller.t line 134. # Structures begin differing at: # $got->[0]{discount} = '2.0000' # $expected->[0]{discount} = '2' # Failed test 'Get Supplier1 (find a bookseller by id)' # at t/db_dependent/Bookseller.t line 153. # Structures begin differing at: # $got->{discount} = '1.0000' # $expected->{discount} = '1' # Looks like you failed 3 tests of 86. t/db_dependent/Bookseller.t .. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/86 subtests Test Summary Report ------------------- t/db_dependent/Bookseller.t (Wstat: 768 Tests: 86 Failed: 3) Failed tests: 9, 11, 15 Non-zero exit status: 3
Fixed by bug 24408 and bug 20906