Skip to content

Comments

Allow package tests to fail gracefully when internet resources are unavailable#107

Merged
stevenpawley merged 3 commits intomainfrom
cran-fix
Jul 6, 2025
Merged

Allow package tests to fail gracefully when internet resources are unavailable#107
stevenpawley merged 3 commits intomainfrom
cran-fix

Conversation

@stevenpawley
Copy link
Member

From the CRAN policy, "Packages which use Internet resources should fail gracefully with an informative message if the resource is not available or has changed (and not give a check warning nor error)."

This PR updates the download_nc_basic function to provide an informative error message when the GRASS example database cannot be downloaded, but without failing. The test suite has also been updated by adding skip_if(is.null(testdata), "GRASS GIS example dataset is not available") to all tests. Almost all tests are dependent on the availability of the example dataset (except where GRASS is initiated from an external spatRaster object). Tests that are dependent on internet resources will be skipped if the example database is not available.

@stevenpawley stevenpawley merged commit 5928dbf into main Jul 6, 2025
6 checks passed
@stevenpawley stevenpawley deleted the cran-fix branch July 6, 2025 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant