Best practices for testing packages with large downloads


#1

Hi,

The Rnightlights package that I am proposing for addition on rOpensci has a few exported functions and the main ones deal with downloading and processing of satellite imagery (~1.5+ GB each) and country polygons (~10+ MB each).

I see from the discussion on best practices for database connections that one can write tests and switch them off for CRAN. Should this apply as well for this case?


#2

hi @cnjuguna - good question.

I think you probably should switch them off for CRAN. you can do this using testthat::skip_on_cran in your tests


#3

hi @sckott,

Thanks. I will give this a go. Also, are there any time bounds on tests? Downloading and processing may take a while and are also dependent on hardware and internet specs.


#4

In general I think, the shorter a test suite is the better. Although of course there are cases where tests just take a long time.

What are the hardware specs required?


#5

Actually no hardware specs really, but the more CPU cores provided the faster data extraction runs. Default is 2 CPU cores.


#6

couldn’t find it in CRAN rules for test length, but one source http://r-pkgs.had.co.nz/tests.html#test-cran says aim for under a minute for your tests to run