Bug 17920 - t/db_dependent/Sitemapper.t fails because of permissions
Summary: t/db_dependent/Sitemapper.t fails because of permissions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Mark Tompsett
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-17 06:41 UTC by Mark Tompsett
Modified: 2018-06-04 20:10 UTC (History)
5 users (show)

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


Attachments
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions (1.12 KB, patch)
2017-01-17 06:44 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions (1.20 KB, patch)
2017-01-17 07:52 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions (1.29 KB, patch)
2017-01-18 12:12 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2017-01-17 06:41:51 UTC
The directory it attempts to create an xml file may not be writable for the user running the test. By changing the directory from the current directory to a temporary one, the test runs. After all 'chmod 777 t/db_dependent' is a bad idea.
Comment 1 Mark Tompsett 2017-01-17 06:44:40 UTC
Created attachment 59060 [details] [review]
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions

The directory it attempts to create an xml file may not be writable for
the user running the test. By changing the directory from the current
directory to a temporary one, the test runs. After all 'chmod 777
t/db_dependent' is a bad idea.

TEST PLAN
---------
1) sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   -- fails
2) apply patch
3) sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   -- succeeds
4) run koha qa test tools
Comment 2 Claire Gravely 2017-01-17 07:52:13 UTC
Created attachment 59067 [details] [review]
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions

The directory it attempts to create an xml file may not be writable for
the user running the test. By changing the directory from the current
directory to a temporary one, the test runs. After all 'chmod 777
t/db_dependent' is a bad idea.

TEST PLAN
---------
1) sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   -- fails
2) apply patch
3) sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   -- succeeds
4) run koha qa test tools

Tested without qa tools
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 3 Jonathan Druart 2017-01-17 08:18:29 UTC
Patch looks ok but I do not recreate:
 sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   Error: The instance doesn't exist: prove t/db_dependent/Sitemapper.t

With -c:
  sudo koha-shell -c "prove t/db_dependent/Sitemapper.t" kohadev

The tests pass, even without the patch.
Comment 4 Marcel de Rooy 2017-01-18 12:12:05 UTC
(In reply to Jonathan Druart from comment #3)
> Patch looks ok but I do not recreate:
>  sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
>    Error: The instance doesn't exist: prove t/db_dependent/Sitemapper.t
> 
> With -c:
>   sudo koha-shell -c "prove t/db_dependent/Sitemapper.t" kohadev
> 
> The tests pass, even without the patch.

Depends on your permissions, but the patch is definitely an improvement.
Comment 5 Marcel de Rooy 2017-01-18 12:12:23 UTC
Created attachment 59157 [details] [review]
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions

The directory it attempts to create an xml file may not be writable for
the user running the test. By changing the directory from the current
directory to a temporary one, the test runs. After all 'chmod 777
t/db_dependent' is a bad idea.

TEST PLAN
---------
1) sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   -- fails
2) apply patch
3) sudo koha-shell "prove t/db_dependent/Sitemapper.t" kohadev
   -- succeeds
4) run koha qa test tools

Tested without qa tools
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2017-01-18 12:13:12 UTC
Mark,
Here are a few other potential candidates:

t/db_dependent/SuggestionEngine_ExplodedTerms.t:    my $location = File::Spec->rel2abs(dirname(__FILE__));
t/db_dependent/www/auth_values_input_www.t:my $testdir = File::Spec->rel2abs( dirname(__FILE__) );
t/db_dependent/www/batch.t:my $testdir = File::Spec->rel2abs( dirname(__FILE__) );
t/db_dependent/www/search_utf8.t:my $testdir = File::Spec->rel2abs( dirname(__FILE__) );
t/db_dependent/zebra_config.pl:my $source = File::Spec->rel2abs('.');
Comment 7 Mark Tompsett 2017-01-18 13:51:53 UTC
(In reply to Marcel de Rooy from comment #6)
> Mark,
> Here are a few other potential candidates:
> 
> t/db_dependent/SuggestionEngine_ExplodedTerms.t:    my $location =
> File::Spec->rel2abs(dirname(__FILE__));
> t/db_dependent/www/auth_values_input_www.t:my $testdir =
> File::Spec->rel2abs( dirname(__FILE__) );
> t/db_dependent/www/batch.t:my $testdir = File::Spec->rel2abs(
> dirname(__FILE__) );
> t/db_dependent/www/search_utf8.t:my $testdir = File::Spec->rel2abs(
> dirname(__FILE__) );
> t/db_dependent/zebra_config.pl:my $source = File::Spec->rel2abs('.');

Since you mentioned these, I'll put these on a separate bug.
Comment 8 Kyle M Hall 2017-01-20 14:06:40 UTC
Pushed to master for 17.05, thanks Mark!
Comment 9 Katrin Fischer 2017-01-22 20:16:51 UTC
This patch has been pushed to 16.11.x and will be in 16.11.02.

Couldn't reproduce the error on kohadevbox, but patches still pass after applying the patch.
Comment 10 Mason James 2017-01-27 03:48:37 UTC
Pushed to 16.05.x, for 16.05.08 release