[Bug 12409] New: The test t/db_dependent/Record.t fails with Perl 5.18.2
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Bug ID: 12409 Summary: The test t/db_dependent/Record.t fails with Perl 5.18.2 Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: yohann.dufour@biblibre.com QA Contact: gmcharlt@gmail.com When I execute the test command : prove t/db_dependent/Record.t , the test fails with the message : t/db_dependent/Record.t .. 1/11 # Failed test 'testing bibtex' # at t/db_dependent/Record.t line 107. # got: '@book{testID, # author = {Rowling, J.K.}, # title = {Harry potter}, # year = {2001}, # publisher = {Scholastic} # } # ' # expected: '@book{testID, # author = {Rowling, J.K.}, # title = {Harry potter}, # publisher = {Scholastic}, # year = {2001} # } # ' # Failed test 'testing bibtex with RDA 264 field' # at t/db_dependent/Record.t line 120. # got: '@book{testID, # publisher = {Reprints}, # year = {2011}, # author = {Rowling, J.K.}, # title = {Harry potter} # } # ' # expected: '@book{testID, # author = {Rowling, J.K.}, # title = {Harry potter}, # publisher = {Reprints}, # year = {2011} # } # ' # Looks like you failed 2 tests of 11. t/db_dependent/Record.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/11 subtests Test Summary Report ------------------- t/db_dependent/Record.t (Wstat: 512 Tests: 11 Failed: 2) Failed tests: 9-10 Non-zero exit status: 2 Files=1, Tests=11, 1 wallclock secs ( 0.03 usr 0.01 sys + 1.33 cusr 0.08 csys = 1.45 CPU) Result: FAIL My OS is Ubuntu 14.04 and my perl version is 5.18.2. It seems to be linked with hash key order randomization. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Yohann Dufour <yohann.dufour@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12343 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jonathan.druart@biblibre.co | |m Assignee|chris@bigballofwax.co.nz |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 28794 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28794&action=edit Bug 14391: Fix fields order on exporting to bibtex The C4::Record::marc2bibtex subroutine supposes hashref keys are sorted which is wrong with perl 5.18 Note that the t/db_dependent/Record.t fails without this patch. Test plan (for perl >= 5.18 only): 1/ prove t/db_dependent/Record.t should return green 2/ Try to export a record to bibtex and verify the order is correct (should be author, title, year, published, etc.). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28794|0 |1 is obsolete| | --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 28848 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28848&action=edit [SIGNED-OFF] Bug 12409: Fix fields order on exporting to bibtex The C4::Record::marc2bibtex subroutine supposes hashref keys are sorted which is wrong with perl 5.18 Note that the t/db_dependent/Record.t fails without this patch. Test plan (for perl >= 5.18 only): 1/ prove t/db_dependent/Record.t should return green 2/ Try to export a record to bibtex and verify the order is correct (should be author, title, year, published, etc.). http://bugs.koha-community.org/show_bug.cgi?id=12409 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Wrong Bug number on heading. Work as described, test pass, no koha-qa errors. The problem is to think that a hash returns keys in a particular order, that's not true and no matter which perl version. Code as was left is... misleading. Comments talks about a hash, which is no more. On array asignment "a => b" is equivalent to "a, b", but the former is usually used on hashes, so a replacement of '=>' by ',' could clarify what are we storing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Bernardo Gonzalez Kriegel from comment #2)
On array asignment "a => b" is equivalent to "a, b", but the former is usually used on hashes, so a replacement of '=>' by ',' could clarify what are we storing.
It was deliberate. In my opinion, it is more readable like that. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- But I really don't matter :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28848|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 29529 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29529&action=edit [PASSED QA] Bug 12409: Fix fields order on exporting to bibtex The C4::Record::marc2bibtex subroutine supposes hashref keys are sorted which is wrong with perl 5.18 Note that the t/db_dependent/Record.t fails without this patch. Test plan (for perl >= 5.18 only): 1/ prove t/db_dependent/Record.t should return green 2/ Try to export a record to bibtex and verify the order is correct (should be author, title, year, published, etc.). http://bugs.koha-community.org/show_bug.cgi?id=12409 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Wrong Bug number on heading. Work as described, test pass, no koha-qa errors. The problem is to think that a hash returns keys in a particular order, that's not true and no matter which perl version. Code as was left is... misleading. Comments talks about a hash, which is no more. On array asignment "a => b" is equivalent to "a, b", but the former is usually used on hashes, so a replacement of '=>' by ',' could clarify what are we storing. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Fixing the comments in a follow-up patch. Tests pass now without problems and records export ok. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 29530 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29530&action=edit Bug 12409: Follow up - Reflect from hash to array in comments -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Yohann! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12409 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #8 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to 3.16.x for inclusion in 3.16.2. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org