[Bug 11480] New: Tests in Output_JSON.t make invalid assumptions
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Bug ID: 11480 Summary: Tests in Output_JSON.t make invalid assumptions Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: colin.campbell@ptfs-europe.com QA Contact: gmcharlt@gmail.com Output_JSON.t fails on current perl release. Tests in Output_JSON.t assume that items in the generated json string will be in a consistent order. Internally, though, they are held in a hash, an unordered container. In perl versions 5.18 and greater the overhaul of of hashing ensures that hash elements are returned in an unpredictable sequence, (which was previously the theory). As a result the tests checking the output should be rewitten not to make assumptions about the order of elements. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|chris@bigballofwax.co.nz |colin.campbell@ptfs-europe. | |com --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 23973 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23973&action=edit Proposed Patch Without this patch the test script is run with perl 5.18 will fail on 0 to 3 tests. (0 is a hard one to spot!) differing on every run. With this patch the results will be consistent -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23973|0 |1 is obsolete| | --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 23981 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23981&action=edit Bug 11480 Fix invalid assumptions in test Tests for Output::JSON made the invalid assumption that the hash keys of the modules internal structure will always be returned in the same sequence. A hash is an unordered structure. as of perl 5.18 this has beem reinforced by random seeding of the hashing function. See the info in perldelta and the doc for JSON This patch changes the tests to be sequence neutral where the previous test was testing that a new element was added and an existing one was untouched these have been separated into individual tests. Some typos in the messages have been corrected Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Test Plan 1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail, but inconsistently under perl 5.18 or greater) 2/ Apply patch 3/ Run t/Output_JSONStream.t 10 tests should pass now -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23981|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24136 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24136&action=edit Bug 11480 Fix invalid assumptions in test Tests for Output::JSON made the invalid assumption that the hash keys of the modules internal structure will always be returned in the same sequence. A hash is an unordered structure. as of perl 5.18 this has beem reinforced by random seeding of the hashing function. See the info in perldelta and the doc for JSON This patch changes the tests to be sequence neutral where the previous test was testing that a new element was added and an existing one was untouched these have been separated into individual tests. Some typos in the messages have been corrected Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Test Plan 1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail, but inconsistently under perl 5.18 or greater) 2/ Apply patch 3/ Run t/Output_JSONStream.t 10 tests should pass now Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #4 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Colin! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11480 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolyn.somers@biblibre.co | |m Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org