Best practices for testing packages with large downloads

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?

1 Like

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

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.

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?

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

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

1 Like