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

2015-06-21 Thread Jennifer Bryan
I hope this is an appropriate to place to ask this. My question involves add-on tools and services, but I think they are in common use and others might have same question. I am using testthat for testing and Travis (https://travis-ci.org) for continuous integration. I do not want the vast majo

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

2015-06-21 Thread Dirk Eddelbuettel
Hi Jenny, And a warm welcome here. I hope you enjoy this place and its ability to form questions (and answers) beyond the 140 char limit posed elsewhere. :-) On 21 June 2015 at 07:46, Jennifer Bryan wrote: | I hope this is an appropriate to place to ask this. My question involves add-on tools

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

2015-06-21 Thread Gábor Csárdi
I think you can just use skip_on_cran() for the tests that you want to skip on CRAN, and set the NOT_CRAN environment variable in your Travis config. Gabor On Sun, Jun 21, 2015 at 10:46 AM, Jennifer Bryan wrote: > I hope this is an appropriate to place to ask this. My question involves > add-on

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

2015-06-21 Thread Zhian Kamvar
I don't know if this is the best way to do it, but I've been using the covr package (https://github.com/jimhester/covr) to run all of my tests on codecov.io even when I use testthat::skip_on_cran(). The only downside is that it increases the amount of time needed for the package to build. HTH,

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

2015-06-21 Thread Dirk Eddelbuettel
On 21 June 2015 at 10:47, Dirk Eddelbuettel wrote: | Environment variables are perfect for this. Eg in RcppRedis I can in fact | assume Redis to be present on Travis (as Travis has a webby-ish focus where | Redis is common) but am fairly certain win-builder and other machines do not. | | So in t

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

2015-06-21 Thread Duncan Murdoch
On 21/06/2015 10:46 AM, Jennifer Bryan wrote: > I hope this is an appropriate to place to ask this. My question involves > add-on tools and services, but I think they are in common use and others > might have same question. > > I am using testthat for testing and Travis (https://travis-ci.org) f

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

2015-06-21 Thread Gábor Csárdi
On Sun, Jun 21, 2015 at 12:09 PM, Duncan Murdoch wrote: > Besides the other suggestions, you can put tests in directories other > than "tests". By default they won't run, but > > R CMD check --test-dir=travisTests > > will run them. So if you can tell travis to add that option to the > command l

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

2015-06-21 Thread Jennifer Bryan
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 t

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

2015-06-21 Thread Duncan Murdoch
On 21/06/2015 1:03 PM, Gábor Csárdi wrote: > On Sun, Jun 21, 2015 at 12:09 PM, Duncan Murdoch > wrote: >> Besides the other suggestions, you can put tests in directories other >> than "tests". By default they won't run, but >> >> R CMD check --test-dir=travisTests >> >> will run them. So if you

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

2015-06-21 Thread Gábor Csárdi
On Sun, Jun 21, 2015 at 8:52 PM, Duncan Murdoch wrote: [...] > > But it's trivial to source files from the tests directory. It is actually often not trivial at all. E.g. if you have a test with setup/teardown, and the setup must be run before each test case, the teardown after, and you want to ru

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

2015-06-21 Thread Duncan Murdoch
On 21/06/2015 9:12 PM, Gábor Csárdi wrote: > On Sun, Jun 21, 2015 at 8:52 PM, Duncan Murdoch > wrote: > [...] >> >> But it's trivial to source files from the tests directory. > > It is actually often not trivial at all. E.g. if you have a test with > setup/teardown, and the setup must be run befo