[Bug 13940] New: Testing C4::OAI::Sets
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Bug ID: 13940 Summary: Testing C4::OAI::Sets Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: trivial Priority: P5 - low Component: Test Suite Assignee: julian.fiol@biblibre.com Reporter: julian.fiol@biblibre.com QA Contact: gmcharlt@gmail.com Testing C4::OAI::Sets in t/db_dependent/OAI/Sets.t Adding &DelOAISetsBiblio in @EXPORT at the beginning of OAI/Sets.pm, it was the only one missing TEST PLAN --------- 1. Apply patch 2. prove -v t/db_dependent/OAI/Sets.t -- All 145 tests should run successfully without any error or warning -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 --- Comment #1 from Julian FIOL <julian.fiol@biblibre.com> --- Created attachment 37429 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37429&action=edit Bug 13940 : Testing C4::OAI::Sets Testing C4::OAI::Sets in t/db_dependent/OAI/Sets.t Adding &DelOAISetsBiblio in @EXPORT at the beginning of OAI/Sets.pm, it was the only one missing TEST PLAN --------- 1. Apply patch 2. prove -v t/db_dependent/OAI/Sets.t -- All 145 tests should run successfully without any error or warning -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Julian FIOL <julian.fiol@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Julian FIOL <julian.fiol@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37429|0 |1 is obsolete| | --- Comment #2 from Julian FIOL <julian.fiol@biblibre.com> --- Created attachment 37433 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37433&action=edit Bug 13940 : Testing C4::OAI::Sets Testing C4::OAI::Sets in t/db_dependent/OAI/Sets.t Adding &DelOAISetsBiblio in @EXPORT at the beginning of OAI/Sets.pm, it was the only one missing TEST PLAN --------- 1. Apply patch 2. prove -v t/db_dependent/OAI/Sets.t -- All 145 tests should run successfully without any error or warning -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 --- Comment #3 from Julian FIOL <julian.fiol@biblibre.com> --- TEST PLAN OPTIONAL ------------------ Go check bug 13899 and see that coverage is 100% for the statements of this module. Coverage BEFORE this patch : Statement : 6,7% Branch : 0,0% Condition : 0,0% Subroutine : 21,1% Pod : 100,0% Coverage AFTER this patch : Statement : 100,0% Branch : 89,5% Condition : 88,8% Subroutine : 100,0% Pod : 100,0% -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 M. Tompsett <mtompset@hotmail.com> 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=13940 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37433|0 |1 is obsolete| | --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 37438 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37438&action=edit Bug 13940 : Testing C4::OAI::Sets Testing C4::OAI::Sets in t/db_dependent/OAI/Sets.t Adding &DelOAISetsBiblio in @EXPORT at the beginning of OAI/Sets.pm, it was the only one missing TEST PLAN --------- 1. Apply patch 2. prove -v t/db_dependent/OAI/Sets.t -- All 145 tests should run successfully without any error or warning 3. Run koha qa test tools -- No issues found. Additionally, I comfirmed why DelOAISetsBiblio was added in the list of exported functions. $ grep "^sub " C4/OAI/Sets.pm | sort > check1 $ for i in `grep "\&[A-Z]" C4/OAI/Sets.pm | xargs `; do echo $i; done | sort > check2 Of course the outputs have a little extra around them, so $ vi check1 $ vi check2 $ diff check1 check2 Lo and behold, it was that one function. Necessary for 100% coverage. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 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=13940 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37438|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37454 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37454&action=edit [PASSED QA] Bug 13940 : Testing C4::OAI::Sets Testing C4::OAI::Sets in t/db_dependent/OAI/Sets.t Adding &DelOAISetsBiblio in @EXPORT at the beginning of OAI/Sets.pm, it was the only one missing TEST PLAN --------- 1. Apply patch 2. prove -v t/db_dependent/OAI/Sets.t -- All 145 tests should run successfully without any error or warning 3. Run koha qa test tools -- No issues found. Additionally, I comfirmed why DelOAISetsBiblio was added in the list of exported functions. $ grep "^sub " C4/OAI/Sets.pm | sort > check1 $ for i in `grep "\&[A-Z]" C4/OAI/Sets.pm | xargs `; do echo $i; done | sort > check2 Of course the outputs have a little extra around them, so $ vi check1 $ vi check2 $ diff check1 check2 Lo and behold, it was that one function. Necessary for 100% coverage. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> 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=13940 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Comment on attachment 37454 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37454 [PASSED QA] Bug 13940 : Testing C4::OAI::Sets
+#Test to enter in the 'else' case of 'AddOAISet' line 280 +{ + my $dbi_st = Test::MockModule->new('DBI::st', no_auto => 1); # ref($sth) == 'DBI::st' + $dbi_st->mock('execute', sub { return 0; }); + + my $setWrong = { + 'spec' => 'specWrong', + 'name' => 'nameWrong', + }; + my $setWrong_id = AddOAISet($setWrong); + + DelOAISet($setWrong_id); +}
It seems to me that you forgot to actually test behaviour here. You are traversing that branch in the code, but still need to test for: - Side effects (no side effects should be tested if such was the case) - The code raises a warning. It whould be tested with a block like this: my $setWrong_id; warning_is ( $setWrong_id = AddOAISet($setWrong) ) 'AddOAISet failed', 'AddOAISet raises warning in XXX condition'; There's also another warning not being tested. You need to add use Test::Warn; for this purpose. I leave you the task to put the pieces together :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 --- Comment #7 from Julian FIOL <julian.fiol@biblibre.com> --- Created attachment 37602 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37602&action=edit Bug 13940 : Testing C4::OAI::Sets (QA followup) Testing C4::OAI::Sets in t/db_dependent/OAI/Sets.t Adding &DelOAISetsBiblio in @EXPORT at the beginning of OAI/Sets.pm, it was the only one missing To Tomás Cohen Arazi on comment #6 : Adding tests on the 2 warnings not tested with 'warning_is' like you suggested it. Hope it's good enough :) TEST PLAN --------- 1. Apply patch 2. prove -v t/db_dependent/OAI/Sets.t -- All 145 tests should run successfully without any error or warning -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Julian FIOL <julian.fiol@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Testing C4::OAI::Sets |Testing C4::OAI::Sets (QA | |followup) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Julian FIOL <julian.fiol@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Julian FIOL <julian.fiol@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37454|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Testing C4::OAI::Sets (QA |Testing C4::OAI::Sets |followup) | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Maybe I wasn't clear enough. Sorry: The regular workflow when we ask for QA followups is to leave the currently testted patch as-is (with its signoffs, for instance) and provide a "new" patch to be applied on top of the original one. *That* new patch should have "(QA followup)" on its subject. Take a look at bug 13075 for example. You'll see an original bug, and a followup (this time made by me). So, I suggest you obsolete the new one, de-obsolete de passed-qa one, and provide just a small followup with the last changes. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37454|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37602|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 --- Comment #9 from Julian FIOL <julian.fiol@biblibre.com> --- Created attachment 37624 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37624&action=edit Bug 13940 : (QA followup) Add tests for the 2 warnings which was not tested -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 --- Comment #10 from Julian FIOL <julian.fiol@biblibre.com> --- Created attachment 37625 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37625&action=edit Bug 13940 : (QA followup) Add test for ModOAISet -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13940 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Good job Julian! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org