Skip to content
Prev 157 / 12125 Next

[R-pkg-devel] how to skip tests on CRAN but NOT on travis-ci?

Thanks for all of the responses!

What Gabor says below is true and is the path of least resistance in my particular case. As Dirk suggested, environment variables are the way to go.

If I put this into .travis.yml:

env:
  - NOT_CRAN=true

I get what I want

  * The Travis build still runs with the option --as-cran.
  * The tests harbouring testthat::skip_on_cran() are run locally and on Travis
  * The tests harbouring testthat::skip_on_cran() are NOT run on CRAN (at least, the little experiment I just ran on winbuilder suggests this ? haven't tried with actual CRAN submission)

TIL: the NOT_CRAN environment variable and the --as-cran option for R CMD check are completely independent of each other.

I also confirmed what Zhian said: if you're using skip_on_cran() and *don't* set NOT_CRAN=true in .travis.yml, you can still get some info about the affected tests in the coveralls result. But this doesn't seem a great solution, since you don't get much detail in the case of failure.

-- Jenny
On 2015-06-21, at 8:51 AM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:

            
Jennifer Bryan
Associate Professor
Department of Statistics and
   the Michael Smith Laboratories
University of British Columbia
Vancouver, BC Canada