On Sun, Jun 21, 2015 at 6:17 PM, Jennifer Bryan <je...@stat.ubc.ca> wrote:
> 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.

Yeah, NOT_CRAN is just a devtools convention - devtools sets not on
CRAN for you, and skip_on_cran() just tests for that env var (since I
have no control over what env vars are set on cran machines).

I think this used to work on travis because the old travis setup
called devtools::check(), while the new setup calls R CMD check
directly.

Hadley

-- 
http://had.co.nz/

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to