Bug 14115 - Silence warnings t/Label*
Summary: Silence warnings t/Label*
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: M. Tompsett
QA Contact: Galen Charlton
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 8879
  Show dependency treegraph
 
Reported: 2015-05-01 21:55 UTC by M. Tompsett
Modified: 2016-12-05 21:23 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 14115: Silence warnings in t/Label* (2.02 KB, patch)
2015-05-01 22:01 UTC, M. Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14115: Silence warnings in t/Label* (2.13 KB, patch)
2015-05-06 20:15 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 14115: Silence warnings in t/Label* (2.08 KB, patch)
2015-05-22 17:36 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 14115: Silence warnings in t/Label* (2.14 KB, patch)
2015-05-26 05:23 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[PASSED QA] Bug 14115: Silence warnings in t/Label* (2.20 KB, patch)
2015-05-29 15:35 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description M. Tompsett 2015-05-01 21:55:24 UTC
Various uninitialized warnings spew out when proving. Clean up output while maintaining test integrity.
Comment 1 M. Tompsett 2015-05-01 22:01:27 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2015-05-06 20:15:45 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-05-22 08:33:37 UTC
Comment on attachment 38907 [details] [review]
[SIGNED-OFF] Bug 14115: Silence warnings in t/Label*

Review of attachment 38907 [details] [review]:
-----------------------------------------------------------------

::: C4/Labels/Label.pm
@@ +115,5 @@
>      my $csv = Text::CSV_XS->new({allow_whitespace => 1});
>      my $status = $csv->parse($format_string);
>      my @sorted_fields = map {{ 'code' => $_, desc => $_ }} 
> +                        map { $_ && $_ eq 'callnumber' ?
> +                              'itemcallnumber' : $_ } # see bug 5653

I am not against cutting lines, but this should be done to improve the readability.
Here you didn't, there are 2 map, and 1 is cut after a ?

Perltidy suggests me:

117     my @sorted_fields = map { { 'code' => $_, desc => $_ } }
118       map { $_ && $_ eq 'callnumber' ? 'itemcallnumber' : $_ }    # see bug 5653
119       $csv->fields();
Comment 4 M. Tompsett 2015-05-22 17:36:58 UTC Comment hidden (obsolete)
Comment 5 Aleisha Amohia 2015-05-26 05:23:36 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2015-05-29 15:35:38 UTC
Created attachment 39692 [details] [review]
[PASSED QA] Bug 14115: Silence warnings in t/Label*

Two functions were triggering noisy warnings while testing:
_get_text_fields and _split_lccn.

TEST PLAN
----------
1) $ prove t/Label*
   -- several warnings
2) apply patch
3) $ prove t/Label*
   -- no warnings
4) koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Nicer, no koha-qa errors

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Tomás Cohen Arazi 2015-06-01 17:19:33 UTC
Patch pushed to master.

Thanks Mark!