Skip to content
Prev 1311 / 12125 Next

[R-pkg-devel] R CMD Check: Tests running infinite

On Mon, Feb 6, 2017 at 12:41 AM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
I wasn't aware of R_TESTS.  Looking at the R source code, if set, will
cause the base package to source that file _before_ and .Rprofile
scripts; it basically calls source(Sys.getenv("R_TESTS")).

Next, R CMD check runs each of the test script using
R_TESTS=startup.Rs, where startup.Rs:

    file.copy(file.path(R.home("share"), "R", "tests-startup.R"), "startup.Rs")
    if (use_gct) cat("gctorture(TRUE)" , file = "startup.Rs", append = TRUE)

Looking at the tests-startup.R file that comes with my R 3.3.2 on
Ubuntu 16.04, it seems pretty harmless:

## A custom startup file for tests
## Run as if a system Rprofile, so no packages, no assignments
options(useFancyQuotes = FALSE)

So, to me it's not clear how this could make a difference in Patrick
case.   By disabling this, i.e. Sys.setenv(R_TESTS=""), I don't see
how it affects running parallel+foreach+doParallel.  Maybe because one
of those packages are relying on fancy quotes in some protocol,
passing command-line arguments or ... something.  I would be curious
to see what file.path(R.home("share"), "R", "tests-startup.R")
contains on the system where the problem occurs.
I wonder if those are mostly there because of cut'n'paste behavior.
My interest in this issue is because I haven't yet experienced this
myself and I run lots and lots of package tests in future that
utilizes the parallel package.  In doFuture I do similar tests, which
is on top of the foreach package.   I don't use testthat and I also
don't use doParallel in my testing.

/Henrik