[Bug 25638] New: API related tests failing on comparing floats
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Bug ID: 25638 Summary: API related tests failing on comparing floats Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Failing on almost all jobs currently 23:42:46 koha_1 | # Failed test 'exact match for JSON Pointer ""' 23:42:46 koha_1 | # at t/db_dependent/api/v1/patrons_accounts.t line 95. 23:42:46 koha_1 | # Structures begin differing at: 23:42:46 koha_1 | # $got->{outstanding_debits}{lines}[0]{amount} = '50' 23:42:46 koha_1 | # $expected->{outstanding_debits}{lines}[0]{amount} = '50.000000' 23:42:46 koha_1 | 23:42:46 koha_1 | # Failed test 'exact match for JSON Pointer ""' 23:42:46 koha_1 | # at t/db_dependent/api/v1/patrons_accounts.t line 139. 23:42:46 koha_1 | # Structures begin differing at: 23:42:46 koha_1 | # $got->{outstanding_credits}{lines}[0]{amount} = '-10' 23:42:46 koha_1 | # $expected->{outstanding_credits}{lines}[0]{amount} = '-10.000000' 23:42:46 koha_1 | # Looks like you failed 2 tests of 12. 23:42:46 koha_1 | 23:42:46 koha_1 | # Failed test 'get_balance() tests' 23:42:46 koha_1 | # at t/db_dependent/api/v1/patrons_accounts.t line 153. 23:42:47 koha_1 | # Looks like you failed 1 test of 2. 23:42:47 koha_1 | [21:42:47] t/db_dependent/api/v1/patrons_accounts.t ................................ 23:42:47 koha_1 | Dubious, test returned 1 (wstat 256, 0x100) 23:42:47 koha_1 | Failed 1/2 subtests 23:43:12 koha_1 | 23:43:12 koha_1 | # Failed test 'SWAGGER3.3.2' 23:43:12 koha_1 | # at t/db_dependent/api/v1/acquisitions_orders.t line 129. 23:43:12 koha_1 | # Structures begin differing at: 23:43:12 koha_1 | # $got->{list_price} = '2.02412229767404e+21' 23:43:12 koha_1 | # $expected->{list_price} = '2024122297674040344576.000000' 23:43:14 koha_1 | 23:43:14 koha_1 | # Failed test 'Number representation should be consistent' 23:43:14 koha_1 | # at t/db_dependent/api/v1/acquisitions_orders.t line 154. 23:43:14 koha_1 | # Structures begin differing at: 23:43:14 koha_1 | # $got->{unit_price_tax_included} = '2.32181072793363e+21' 23:43:14 koha_1 | # $expected->{unit_price_tax_included} = '2321810727933630742528.000000' 23:43:14 koha_1 | # Looks like you failed 2 tests of 8. 23:43:14 koha_1 | 23:43:14 koha_1 | # Failed test 'get() tests' 23:43:14 koha_1 | # at t/db_dependent/api/v1/acquisitions_orders.t line 158. 23:43:22 koha_1 | # Looks like you failed 1 test of 5. 23:43:22 koha_1 | [21:43:22] t/db_dependent/api/v1/acquisitions_orders.t ............................. 23:43:22 koha_1 | Dubious, test returned 1 (wstat 256, 0x100) 23:43:22 koha_1 | Failed 1/5 subtests 23:43:50 koha_1 | 23:43:50 koha_1 | # Failed test 'SWAGGER3.3.2' 23:43:50 koha_1 | # at t/db_dependent/api/v1/items.t line 131. 23:43:50 koha_1 | # Structures begin differing at: 23:43:50 koha_1 | # $got->{purchase_price} = '742834.7' 23:43:50 koha_1 | # $expected->{purchase_price} = '742834.70' 23:43:50 koha_1 | # Looks like you failed 1 test of 9. 23:43:50 koha_1 | 23:43:50 koha_1 | # Failed test 'get() tests' 23:43:50 koha_1 | # at t/db_dependent/api/v1/items.t line 143. 23:43:50 koha_1 | # Looks like you failed 1 test of 2. 23:43:50 koha_1 | [21:43:50] t/db_dependent/api/v1/items.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://github.com/mojolici | |ous/json-validator/commit/8 | |b19ba025633597de49b6ec9e352 | |46c71580271e -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- It is urgent because it makes noise, but it is not critical, as the resulting float representations on the API are valid. This is more of a way we test and how things are compared on the tests. I will be spending time on trying to solve this. I think we will end up reverting the removal of the Koha::Object->TO_JSON code, and adding a coercion on the decimal representation... But it is just a guess... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |25513 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25513 [Bug 25513] Integer casting in Koha::Object->TO_JSON causes random test failures -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105484&action=edit Bug 25638: Revert "Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON" This reverts commit a79cf4150e8a08e743acc7d7147af91757d7a9b8. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105485 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105485&action=edit Bug 25638: Fix floag/decimal comparison in API related tests The previous fix from bug 25513 does not work in all versions we are supporting. Let's hack the float/decimal columns in the same way we did for integer. prove t/db_dependent/api/v1/acquisitions_vendors.t t/db_dependent/api/v1/patrons_accounts.t t/db_dependent/api/v1/acquisitions_orders.t Note that there is another error on U20 for acquisitions_orders.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105484|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 105582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105582&action=edit Bug 25638: Revert "Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON" This reverts commit a79cf4150e8a08e743acc7d7147af91757d7a9b8. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105485|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 105583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105583&action=edit Bug 25638: Fix floag/decimal comparison in API related tests The previous fix from bug 25513 does not work in all versions we are supporting. Let's hack the float/decimal columns in the same way we did for integer. prove t/db_dependent/api/v1/acquisitions_vendors.t t/db_dependent/api/v1/patrons_accounts.t t/db_dependent/api/v1/acquisitions_orders.t Note that there is another error on U20 for acquisitions_orders.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Needs Signoff |Signed Off --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected.. this is a reasonable interim measure whilst we work on converting to use MariaDB::DBD -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105590 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105590&action=edit Bug 25638: Fix failure on Koha/Object.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105590|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105582|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105583|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105595 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105595&action=edit Bug 25638: Add tests for JSON conversion vs DBD::mysql We have the situation of needing to cast numbers so they are not confused in JSON with strings by DBD::mysql returning them with the wrong internal flags. We have also recently removed the cast, and adding it back now. This test could help us detect this situation in case we make changes in the area, and even on specific libraries versions. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105596 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105596&action=edit Bug 25638: Revert "Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON" This reverts commit a79cf4150e8a08e743acc7d7147af91757d7a9b8. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105597 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105597&action=edit Bug 25638: Fix float/decimal comparison in API related tests The previous fix from bug 25513 does not work in all versions we are supporting. Let's hack the float/decimal columns in the same way we did for integer. prove t/db_dependent/api/v1/acquisitions_vendors.t \ t/db_dependent/api/v1/patrons_accounts.t \ t/db_dependent/api/v1/acquisitions_orders.t Note that there is another error on U20 for acquisitions_orders.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105598 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105598&action=edit Bug 25638: Fix regression Now that float/decimal columns are not treated similar to integer ones, the default value handling we had set for numeric values is not trapping the float/decimal cases as it should. We love tests! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105599 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105599&action=edit Bug 25638: Update TODO Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105665 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105665&action=edit Bug 25638: Make the tests pass - ignoring the actual issue The API related tests still don't pass with the previous modifications. They pass on D10 but fail on U18 and I did not manage to find where the problems come from. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|jonathan.druart@bugs.koha-c |chris@bigballofwax.co.nz |ommunity.org | --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushing this last patch to turn Jenkins green and move on. However this still need to be addressed in my opinion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.01 released in| | --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- All test pass! Backported to 20.05.x for 20.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #17 from Aleisha Amohia <aleisha@catalyst.net.nz> --- missing dependencies, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com Status|NEW |RESOLVED --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #15)
Pushing this last patch to turn Jenkins green and move on.
However this still need to be addressed in my opinion.
Additional work must be done on a separate bug report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25638 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed, | |RM_priority | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org