Bug 11541 - Increasing test coverage for C4::Installer
Summary: Increasing test coverage for C4::Installer
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Cormack
QA Contact: Galen Charlton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 01:14 UTC by Aleisha Amohia
Modified: 2014-12-07 20:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (1.42 KB, patch)
2014-01-14 01:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 11541: Increasing coverage of Installer.pm (1.47 KB, patch)
2014-01-14 02:37 UTC, Francesca
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11541: Increasing coverage of Installer.pm (1.54 KB, patch)
2014-01-14 20:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 11541 [Followup] - Increasing test coverage for C4::Installer (2.48 KB, patch)
2014-01-14 20:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 11541: Increasing coverage of Installer.pm (1.52 KB, patch)
2014-01-14 20:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 11541 [Followup] - Increasing test coverage for C4::Installer (2.54 KB, patch)
2014-01-14 20:19 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[PASSED QA] Bug 11541: Increasing coverage of Installer.pm (1.61 KB, patch)
2014-01-14 21:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11541 [Followup] - Increasing test coverage for C4::Installer (2.60 KB, patch)
2014-01-14 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2014-01-14 01:14:14 UTC

    
Comment 1 Aleisha Amohia 2014-01-14 01:27:12 UTC Comment hidden (obsolete)
Comment 2 Francesca 2014-01-14 02:37:31 UTC Comment hidden (obsolete)
Comment 3 David Cook 2014-01-14 05:35:56 UTC
I ran into a problem with the test plan. 

t/Installer.t doesn't exist prior to this patch.

Is this patch introducing a new test, or is this supposed to be an improvement of t/Installer_pm.t?
Comment 4 Chris Cormack 2014-01-14 05:43:29 UTC
Ah yes, this new patch tests

C4::Installer

t/Installer_pm.t on the other hand tests
C4::Installer::PerlModules

So yep, it is a new test file.
Comment 5 David Cook 2014-01-14 06:13:03 UTC
(In reply to Chris Cormack from comment #4)
> Ah yes, this new patch tests
> 
> C4::Installer
> 
> t/Installer_pm.t on the other hand tests
> C4::Installer::PerlModules
> 
> So yep, it is a new test file.

Cool. In that case, don't we need to add a call to this test elsewhere in Koha?
Comment 6 Chris Cormack 2014-01-14 06:19:00 UTC
Nope, if its in the t/ dir, it gets run (by jenkins and by make test)
Comment 7 Kyle M Hall 2014-01-14 20:03:55 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2014-01-14 20:06:17 UTC Comment hidden (obsolete)
Comment 9 Aleisha Amohia 2014-01-14 20:18:24 UTC Comment hidden (obsolete)
Comment 10 Aleisha Amohia 2014-01-14 20:19:19 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2014-01-14 21:01:59 UTC
Created attachment 24314 [details] [review]
[PASSED QA] Bug 11541: Increasing coverage of Installer.pm

To test
1. Run prove t/Installer.t
2. Apply patch
3. Run prove t/Installer.t
   Notice more tests are run

Signed-off-by: Francesca Moore <francescalamoore@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass :)
Comment 12 Katrin Fischer 2014-01-14 21:02:13 UTC
Created attachment 24315 [details] [review]
[PASSED QA] Bug 11541 [Followup] - Increasing test coverage for C4::Installer

Tests succeed, but cause many warnings:

prove t/Installer.t
t/Installer.t .. 1/9 "my" variable $self masks earlier declaration in
same scope at t/Installer.t line 19.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 20.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 21.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 22.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 23.
Odd number of elements in anonymous hash at t/Installer.t line 17.
Use of uninitialized value within @ARGV in anonymous hash ({}) at
t/Installer.t line 17.

The patch remedies that.

Test Plan:
1) Apply first patch on this bug
2) Run "prove t/Installer.t"
3) Note the warnings
4) Apply this patch
5) Repeat step 2
6) Note the warnings are gone

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 13 Galen Charlton 2014-01-14 22:24:37 UTC
Pushed to master, along with a couple follow-ups to put the test in the db_dependent subdirectory and test the values of the fields in the $installer object more precisely.

Congratulations on having your first patch accepted into Koha, Aleisha!