[Debian-med-packaging] Unit tests of R BatchJobs

Andreas Tille andreas at an3as.eu
Fri Jun 27 07:28:58 UTC 2014


Hi Michel,

On Thu, Jun 26, 2014 at 11:21:21PM +0200, Michel Lang wrote:
> I suppose that this discussion is not intended for everyone on the
> mailing list. If I'm wrong, feel free to forward this mail.

I'm doing this hereby since I follow the policy that all such details
should be open.
 
> Can you please elaborate on the process of testing a Debian R package?
> I'm curious why you don't call "R CMD check <pkg.tar.gz>" to test a
> package.

We are trying to test the *installed* Debian package which has no tar.gz
but rather files installed to (in this case)

   /usr/lib/R/site-library/BatchJobs

while the files from the tests directory (in the case of BatchJobs)
are used to fire up the testsuite.  So the test is done like this:

ADTTMP=`mktemp -d /tmp/r-cran-batchjobs-test.XXXXXX`
cd $ADTTMP
cp -a /usr/share/doc/r-cran-batchjobs/tests/run-all.R $ADTTMP
LC_ALL=C R --no-save < run-all.R

which might boils down to a simple

$ LC_ALL=C R --no-save <<EOT
library(testthat)
library(BatchJobs)
test_package("BatchJobs")
EOT

which does result in the error messages I posted while when running
as root works nicely.

> This should always work if started from a subshell in
> $TMPDIR. Do you use a sandbox or chroot while testing?

The automatic tests will be done in a chroot (my manual test of the
script was not).

> Do you rely on
> the exit code to determine whether a test was successful?

Yes.

> The warnings regarding SQLite are a bit strange. We depend on RSQLite,
> but we do not link against it. Probably RSQLite is just linked against
> a previously installed system lib.

That's correct - please forget this part of my mail.

Thanks for your both very quick responses

    Andreas.

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list