Skip to content

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

10 messages · stefano iacus, Spencer Graves, iuke-tier@ey m@iii@g oii uiow@@edu +4 more

#
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*

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
#
On 08.06.2020 16:26, stefano wrote:
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
#
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 at statistik.tu-dortmund.de> ha scritto:

  
  
#
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:
#
On 08.06.2020 16:52, Spencer Graves wrote:
Nor do I how they can find out, as our idea is that CRAN cannot be 
special cased.
If you want to run additional tests, you can execute them if some env 
var is set that you define on machines where you want to run the 
additional tests.

Best,
Uwe Ligges
#
function () 
{
     skip_if(on_cran(), "On CRAN")
}
<bytecode: 0x5559f11a2d90>
<environment: namespace:testthat>
function () 
!identical(Sys.getenv("NOT_CRAN"), "true")
<bytecode: 0x5559f12f5180>
<environment: namespace:testthat>

Best,

luke
On Mon, 8 Jun 2020, Uwe Ligges wrote:

            

  
    
#
On Mon, Jun 8, 2020 at 3:58 PM Uwe Ligges
<ligges at statistik.tu-dortmund.de> wrote:
[...]
[...]

That is exactly how testthat::skip_on_cran() works. If you set
`NOT_CRAN="true"` then the test runs. And to make it more helpful,
Travis, GitHub Actions, etc. automatically set it.

Gabor
#
On 08.06.2020 17:02, G?bor Cs?rdi wrote:
Thanks to Luke and Gabor for enlighting me.

Uwe
#
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 at r-project.org> Im Auftrag von Spencer Graves
Gesendet: Montag, 8. Juni 2020 16:53
An: r-package-devel at 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:
______________________________________________
R-package-devel at 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
#
The built-in way is to put those tests in a separate directory, and 
specify that directory when you run R CMD check.  For example, rgl has 
directory "inst/slowTests", and I use these options to R CMD check:

--test-dir=inst/slowTests

Duncan Murdoch
On 08/06/2020 10:52 a.m., Spencer Graves wrote: