Bug 11541

Summary: Increasing test coverage for C4::Installer
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: Test SuiteAssignee: Chris Cormack <chris>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: enhancement    
Priority: P5 - low CC: dcook, francescalamoore, kyle
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
Bug 11541: Increasing coverage of Installer.pm
[SIGNED-OFF] Bug 11541: Increasing coverage of Installer.pm
Bug 11541 [Followup] - Increasing test coverage for C4::Installer
Bug 11541: Increasing coverage of Installer.pm
Bug 11541 [Followup] - Increasing test coverage for C4::Installer
[PASSED QA] Bug 11541: Increasing coverage of Installer.pm
[PASSED QA] Bug 11541 [Followup] - Increasing test coverage for C4::Installer

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 (khall) 2014-01-14 20:03:55 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall (khall) 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!