[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Unittest of oligoClasses tries to write data to /usr/local/lib/R/site-library



Andreas,

I understand your point and I'll analyze the code looking for a solution...

The issue seems to come from the fact that the test depends on the pd.mapping50k.hind240 bioc package, which wasn't available... Then, an automatic download process starts and doesn't write to the user-specific libpath, but to the system-wide libpath, instead. When we wrote this code, we expected that the user would be able to write to .libPaths()[1] . Maybe there is a canonical way of handling this?

If you have suggestions, please let me know... In the meantime, I'll try to solve this without a circular dependency...

benilton

Em seg., 15 de mar. de 2021 às 13:32, Andreas Tille <andreas@an3as.eu> escreveu:
Hi Benilton,

thank you for your quick response.

On Mon, Mar 15, 2021 at 11:46:39AM -0300, Benilton Carvalho wrote:
> Hi Andreas,
>
> It seems to me that the only reason the code attempts to write on
> /usr/local/lib/R/site-library is because that's where the package (is
> being/was) installed and that's an option made by the user.

That's correct in some way:  Debian packages will install packages under
/usr.  If a user installs the R package manually for sure permissions
for the target location exist automatically.  But this is not the case
if the sysadmin installs the Debian package.  IMHO it is not a good idea
to mix test data with production code - no matter whether it is
technically possible by user permissions or not.

> I might be
> wrong though, given that this is code that has been stable for almost 10
> years now.

May be since the setup that the user who wants to run the test suite
has not permissions to write to the installation location was never
tested.

> What's the common practice among the packages that pass the
> tests under the Debian framework?

I have no experience with RUnit tests that are downloading data from
remote.  For tests based on testthat the whole test suite is copied to
/tmp/SOME_TEST_DIR and there the user is free to create new files.  If
there is an option to copy the testsuite somewhere else and run RUnit
there this would be an option.

> Thank you so much for reaching out,

You are welcome and thanks for your quick response

    Andreas.

> benilton
>
> Em seg., 15 de mar. de 2021 às 09:32, Andreas Tille <tille@debian.org>
> escreveu:
>
> > Hi,
> >
> > the Debian R packaging team has created Debian packages of oligoClasses.
> > When running the test suite I get:
> >
> > ...
> > Executing test function test_CopyNumberSet_construction  ... Loading
> > required package: pd.mapping50k.hind240
> > Attempting to obtain 'pd.mapping50k.hind240' from BioConductor website.
> > Checking to see if your internet connection works...
> > You do not have write access to '/usr/local/lib/R/site-library'.
> > Timing stopped at: 0.077 0.019 0.899
> > Error in get(annotation) : object 'pd.mapping50k.hind240' not found
> >  done successfully.
> > Executing test function test_dataExamples  ...  done successfully.
> > Executing test function test_GenomeAnnotatedDataFrame_construction  ...
> > Loading required package: pd.mapping50k.hind240
> >  done successfully.
> > Executing test function test_GenomeAnnotatedDataFrameWithFF  ... Loading
> > required package: pd.mapping50k.hind240
> > Attempting to obtain 'pd.mapping50k.hind240' from BioConductor website.
> > Checking to see if your internet connection works...
> > You do not have write access to '/usr/local/lib/R/site-library'.
> > Timing stopped at: 0.148 0.001 0.566
> > Error in get(annotation) : object 'pd.mapping50k.hind240' not found
> > In addition: Warning message:
> > In library(package, lib.loc = lib.loc, character._only_ = TRUE,
> > logical.return = TRUE,  :
> >   there is no package called ‘pd.mapping50k.hind240’
> >  done successfully.
> > Executing test function test_oligoSnpSet_construction  ... Loading
> > required package: pd.mapping50k.hind240
> > ...
> >
> >
> > When running the test as root it passes successfully but I think
> > tests should not touch /usr in general.
> >
> > Kind regards
> >
> >       Andreas.
> >
> >
> > --
> > http://fam-tille.de
> >

--
http://fam-tille.de

Reply to: