[R-pkg-devel] email misleading: checking CRAN incoming feasibility ... NOTE Maintainer

Daniel Lüdecke d@|uedecke @end|ng |rom uke@de
Mon Jun 8 17:08:07 CEST 2020


Hi Spencer,

the NOTE you posted in your email was related to examples, so you probably don't need to remove tests. You can wrap part of the examples in \dontrun{} to reduce check time for examples.

As for tests, there are several ways of skipping (long-running) tests on CRAN. If you're using testthat, you typically have code chunks like this in your test-files:

  test_that("my_function", {
    expect_false(...)
    expect_equal(...)
  })

Just insert a "testthat::skip_on_cran()" as first line in that code-chunk:

  test_that("my_function", {
    skip_on_cran()
    expect_false(...)
    expect_equal(...)
  })

This will skip this particular test.

Another way if you want to run a complete test-file only locally depends on versioning. I always use 4 decimals as version numbers for my packages in development, e.g. package_0.1.2.3, and on CRAN, only three decimals: package_0.1.3 (this related to the package version you define in the DESCRIPTION file). If you follow this rules, you can set a global environment variable in the main test file, when you use "testthat", you should insert following code (change package name accordingly) in "testthat.R":

if (length(strsplit(packageDescription("my_package")$Version, "\\.")[[1]]) > 3) {
  Sys.setenv("RunAllPkgTests" = "yes")
} else {
  Sys.setenv("RunAllPkgTests" = "no")
}

For versions on CRAN (i.e. version number like 0.1.0), the environment variable "RunAllPkgTests" is "no", for your local package with version number like 0.1.0.1 this would be "yes". Then you wrap your complete test file into an if-statement:

.runThisTest <- Sys.getenv("RunAllinsightTests") == "yes"

if (.runThisTest) {
  # ... all my tests here
}

Here's a practical example:
https://github.com/easystats/insight/blob/master/tests/testthat.R
https://github.com/easystats/insight/blob/master/tests/testthat/test-bigglm.R

And for skip_on_cran() / skip_on_travis:
https://github.com/easystats/insight/blob/cddc6df6783aae859f2b707dd5a938493bff3aaa/tests/testthat/test-spatial.R#L141

Hope this helps!

Best
Daniel

-----Ursprüngliche Nachricht-----
Von: R-package-devel <r-package-devel-bounces using r-project.org> Im Auftrag von Spencer Graves
Gesendet: Montag, 8. Juni 2020 16:53
An: r-package-devel using r-project.org
Betreff: Re: [R-pkg-devel] email misleading: checking CRAN incoming feasibility ... NOTE Maintainer

Hi, Uwe et al.:


       What's the preferred way to eliminate tests on CRAN that the 
maintainer still wants to run on other platforms?


       For several years, I've been using "if(!fda::CRAN()){...}". I've 
been told that I should NOT do that, but it has worked for me, and I 
haven't found anything better.  I've recently seen 
"testthat::skip_on_cran(...)", but I have yet to understand enough of 
how it works to actually use it.


       Thanks,
       Spencer Graves


On 2020-06-08 09:43, stefano wrote:
> Hello Uwe,
>
> OK sorry for that.
>
> Best wishes.
>
> *Stefano *
>
>
>
> Stefano Mangiola | Postdoctoral fellow
>
> Papenfuss Laboratory
>
> The Walter Eliza Hall Institute of Medical Research
>
> +61 (0)466452544
>
>
> Il giorno mar 9 giu 2020 alle ore 00:40 Uwe Ligges <
> ligges using statistik.tu-dortmund.de> ha scritto:
>
>>
>> On 08.06.2020 16:26, stefano wrote:
>>> Hello,
>>>
>>> I would like to point out that I (and others in various forums) find that
>>> the CRAN check with the note :
>>>
>>>
>>> *checking CRAN incoming feasibility ... NOTEMaintainer*
>>
>> Not true, it also says
>>
>> Flavor: r-devel-windows-ix86+x86_64
>> Check: running examples for arch 'x64', Result: NOTE
>>     Examples with CPU (user + system) or elapsed time > 10s
>>                               user system elapsed
>>     lower_triangular-methods 11.48      0    11.5
>>
>> Please reduce each example to less than 5 sec.
>>
>> Best,
>> Uwe Ligges
>>> Triggers an email saying
>>>
>>>
>>> 1) *package nanny_0.1.7.tar.gz does not pass the incoming checks
>>> automatically*
>>>
>>> 2) *Please fix all problems and resubmit a fixed version via the webform*
>>>
>>>
>>> While apparently nothing should be done, at least according to some forum
>>> post
>>>
>> https://stackoverflow.com/questions/23829978/checking-cran-incoming-feasibility-note-maintainer
>>> It would be nice to avoid this from the test side or the email side. It
>> is
>>> pretty confusing for developers who think that they have to act.
>>>
>>>
>>> Best wishes.
>>>
>>> *Stefano *
>>>
>>>
>>>
>>> Stefano Mangiola | Postdoctoral fellow
>>>
>>> Papenfuss Laboratory
>>>
>>> The Walter Eliza Hall Institute of Medical Research
>>>
>>> +61 (0)466452544
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-package-devel using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

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

--

_____________________________________________________________________

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de
Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Joachim Prölß, Prof. Dr. Blanche Schwappach-Pignataro, Marya Verdel
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING


More information about the R-package-devel mailing list