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

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


Attachments
Bug 17920: t/db_dependent/Sitemapper.t fails because of permissions (1.12 KB, patch)
2017-01-17 06:44 UTC, M. 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 M. 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 M. 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 M. 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