[Bug 43617] New: COUNTER 5.1 SUSHI parser drops usage data when a Report_Item has multiple Attribute_Performance entries
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 Bug ID: 43617 Summary: COUNTER 5.1 SUSHI parser drops usage data when a Report_Item has multiple Attribute_Performance entries Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ERM Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart@gmail.com, jonathan.field@openfifth.co.uk, martin.renvoize@openfifth.co.uk, matt.blenkinsop@openfifth.co.uk, pedro.amorim@openfifth.co.uk Target Milestone: --- Hello, COUNTER 5.1 introduced Attribute_Performance, an array nested inside a single Report_Item. A platform or database that serves several content types gets several entries in this array for the same Report_Item. So I tried to fix that with the following patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |BibLibre list of Sponsors| | Status|NEW |Needs Signoff Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 --- Comment #1 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 206655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206655&action=edit Bug 43617: Handle multiple Attribute_Performance entries Assisted by Sonnet to build unit test Test plan: 1) Apply the patch 2) Run this one-liner, which builds a COUNTER 5.1 CSV report the same way Koha does when harvesting via SUSHI, from a JSON response modeling a real-world case: a Platform Report where one platform ("nature.com") reports both Searches_Platform and Total_Item_Requests via two Attribute_Performance entries, and another ("Springer Nature Link") reports Total_Item_Requests spread across three content types (Journal, Book, Reference_Work) via three Attribute_Performance entries: perl -Ilib -e ' use Modern::Perl; use JSON qw( decode_json ); use File::Slurp; use Koha::ERM::EUsage::SushiCounter; my $data = decode_json(read_file( "t/db_dependent/data/erm/eusage/COUNTER_5.1/PR_P1.json")); my $counter = Koha::ERM::EUsage::SushiCounter->new({ response => $data }); print $counter->get_COUNTER_from_SUSHI; ' Without patch, the body only contains: nature.com,Total_Item_Requests,60,10,20,30 - the Searches_Platform row for nature.com is missing entirely, and Total_Item_Requests for Springer Nature Link only reflects the Reference_Work entry (60) instead of the sum of all three (111). With patch, the body contains: nature.com,Searches_Platform,330,100,110,120 nature.com,Total_Item_Requests,180,50,60,70 "Springer Nature Link",Total_Item_Requests,111,16,37,58 3) Run the unit tests: prove -v t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t Sponsored-by: BibLibre Assisted-by: Sonnet 5 (Anthropic) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|COUNTER 5.1 SUSHI parser |ERM COUNTER 5.1 SUSHI |drops usage data when a |parser drops usage data |Report_Item has multiple |when a Report_Item has |Attribute_Performance |multiple |entries |Attribute_Performance | |entries Severity|enhancement |normal CC| |clemens.tubach@kit.edu, | |michaela.sieber@kit.edu -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #2 from David Nind <david@davidnind.com> --- Failed QA as the tests fail for me. Also, it is not possible the way the patches are attached to test step 2 of the test plan before the patch is applied, as the script relies on the new test. (Unless you do some git jiggery pokery to revert some changes.) Test failures: prove t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t .. 1/22 # Failed test '11th column is reporting period total' # at t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t line 642. # got: '1280' # expected: '640' # Looks like you failed 1 test of 25. # Failed test 'TR_J4 _COUNTER_report_body' # at t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t line 653. # Failed test '4th column is month column heading' # at t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t line 1125. # got: 'Jan-2022' # expected: 'Jan 2022' # Failed test '5th column is another month column heading' # at t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t line 1126. # got: 'Feb-2022' # expected: 'Feb 2022' # Failed test '6th column is the last month column heading' # at t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t line 1127. # got: 'Mar-2022' # expected: 'Mar 2022' # Looks like you failed 3 tests of 7. # Failed test 'PR_P1 _COUNTER_report_column_headings' # at t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t line 1129. # Looks like you failed 2 tests of 22. t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/22 subtests Test Summary Report ------------------- t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t (Wstat: 512 (exited 2) Tests: 22 Failed: 2) Failed tests: 12, 20 Non-zero exit status: 2 Files=1, Tests=22, 2 wallclock secs ( 0.04 usr 0.01 sys + 1.67 cusr 0.22 csys = 1.94 CPU) Result: FAIL -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org