[Bug 36935] New: BackgroundJob/ImportKBARTFile.t generates warnings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Bug ID: 36935 Summary: BackgroundJob/ImportKBARTFile.t generates warnings Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: matt.blenkinsop@ptfs-europe.com Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org Blocks: 25515 koha_1 | 2012, EOF - End of data in parsing input stream, 0 at /kohadevbox/koha/Koha/BackgroundJob/ImportKBARTFile.pm line 247, <$fh> line 3. koha_1 | 2012, EOF - End of data in parsing input stream, 0 at /kohadevbox/koha/Koha/BackgroundJob/ImportKBARTFile.pm line 247, <$fh> line 3. koha_1 | 2012, EOF - End of data in parsing input stream, 0 at /kohadevbox/koha/Koha/BackgroundJob/ImportKBARTFile.pm line 247, <$fh> line 3. koha_1 | 2012, EOF - End of data in parsing input stream, 0 at /kohadevbox/koha/Koha/BackgroundJob/ImportKBARTFile.pm line 247, <$fh> line 3. koha_1 | [15:09:28] t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t ......................... ok 3354 ms ( 0.01 usr 0.00 sys + 2.84 cusr 0.32 csys = 3.17 CPU) Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25515 [Bug 25515] [OMNIBUS] Remove warnings and errors from tests output -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #1 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167078 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167078&action=edit Bug 36935: Remove warning if file parsing is successful This patch removes the logged warning if a file parse is successful. Test plan: 1) prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t 2) The output will have a logged message - 'EOF - End of data in parsing input stream' 3) Apply patch 4) Repeat step 1 5) The warning will be gone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- errno 2012 means successful? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #3 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Apparently so! https://metacpan.org/pod/Text::CSV_XS#DIAGNOSTICS -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167078|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 167080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167080&action=edit Bug 36935: Remove warning if file parsing is successful This patch removes the logged warning if a file parse is successful. Test plan: 1) prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t 2) The output will have a logged message - 'EOF - End of data in parsing input stream' 3) Apply patch 4) Repeat step 1 5) The warning will be gone Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Matt Blenkinsop from comment #3)
Apparently so! https://metacpan.org/pod/Text::CSV_XS#DIAGNOSTICS
I am not sure, this is not clear for me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- use Text::CSV_XS; open(my $fh, "<", '/tmp/file') or die $!; my $csv = Text::CSV_XS->new( { sep_char => ',', binary => 1, allow_loose_quotes => 1 } ); my @lines = @{$csv->getline_all($fh)}; close($fh); my ( $cde, $str, $pos ) = $csv->error_diag(); my $error = $cde ? "$cde, $str, $pos" : ""; use Data::Printer colored => 1; say p @lines; /tmp/file contains one,two,three 1,2,3 4,5,6 7,8,9 run the script and get no error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- open my $fh, "<", \$file_content or die; This must die with the reason! The bare minimum is 'die $!' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Or add a newline to the input file or so ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167080|0 |1 is obsolete| | --- Comment #9 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167088 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167088&action=edit Bug 36935: Remove warning if file parsing is successful This patch removes the logged warning if a file parse is successful. Test plan: 1) prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t 2) The output will have a logged message - 'EOF - End of data in parsing input stream' 3) Apply patch 4) Repeat step 1 5) The warning will be gone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #10 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167089 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167089&action=edit Bug 36935: Add a 'die' message to file parsing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- Is this error handling covered by a test? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #12 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Not currently, I'll add one. Patch incoming -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #13 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- If I force the error handling to throw an error in a unit test we will get a warning in the output which is what we're trying to avoid. Now that we're identifying the end of file we could throw a Koha::Exception rather than a warning? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #14 from Jonathan Druart <jonathan.druart@gmail.com> --- Use Test::Warn (warning_is for instance) if you want to test that a warning will be displayed in the log. An exception would be better ofc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #15 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167099 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167099&action=edit Bug 36935: Add unit test for error handling prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #16 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Bug 36942 raised for throwing an exception, will try and have a look at that when I have some time -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167088|0 |1 is obsolete| | --- Comment #17 from David Nind <david@davidnind.com> --- Created attachment 167130 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167130&action=edit Bug 36935: Remove warning if file parsing is successful This patch removes the logged warning if a file parse is successful. Test plan: 1) prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t 2) The output will have a logged message - 'EOF - End of data in parsing input stream' 3) Apply patch 4) Repeat step 1 5) The warning will be gone Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167089|0 |1 is obsolete| | --- Comment #18 from David Nind <david@davidnind.com> --- Created attachment 167131 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167131&action=edit Bug 36935: Add a 'die' message to file parsing Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167099|0 |1 is obsolete| | --- Comment #19 from David Nind <david@davidnind.com> --- Created attachment 167132 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167132&action=edit Bug 36935: Add unit test for error handling prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36831 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36831 [Bug 36831] Add support for .txt files to the KBART import tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com CC| |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=36935 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167130|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168326&action=edit Bug 36935: Remove warning if file parsing is successful This patch removes the logged warning if a file parse is successful. Test plan: 1) prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t 2) The output will have a logged message - 'EOF - End of data in parsing input stream' 3) Apply patch 4) Repeat step 1 5) The warning will be gone Signed-off-by: David Nind <david@davidnind.com> 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=36935 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167131|0 |1 is obsolete| | --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168327 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168327&action=edit Bug 36935: Add a 'die' message to file parsing Signed-off-by: David Nind <david@davidnind.com> 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=36935 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167132|0 |1 is obsolete| | --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168328 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168328&action=edit Bug 36935: Add unit test for error handling prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t Signed-off-by: David Nind <david@davidnind.com> 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=36935 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks Matt, always good to make the tests a little cleaner :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|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=36935 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|24.11.00 |24.11.00,24.05.06 released in| | Status|Pushed to main |Pushed to stable --- Comment #25 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Depends on| |34788 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34788 [Bug 34788] Add the ability to import KBART files to ERM -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #26 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 34788 not in 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED CC| |david@davidnind.com Resolution|--- |FIXED Text to go in the| |This removes unnecessary release notes| |warning messages generated | |in the log files if the | |import of KBART files in | |the ERM module are | |successful (EOF - End of | |data in parsing input | |stream). It also adds error | |handling tests to the test | |suite. --- Comment #27 from David Nind <david@davidnind.com> --- Affects the log files and tests, so no changes required to the manual. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|25515 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25515 [Bug 25515] [OMNIBUS] Remove warnings and errors from tests output -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36935 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40444 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40444 [Bug 40444] Add a test to ensure all Perl test files use Test::NoWarnings -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org