You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for test_if_offline() doesn't mention that this function requires the optional dependency, curl. Because of how skipping tests works and common patterns of use like r-lib/actions, this makes it easy to think tests are passing (i.e. gh-actions reports success) when in fact all tests that need network are being skipped because the package did not suggest curl in addition to suggesting testthat. I think I am not alone in not reading the testthat logs of every successful github action check, many of us look at logs closely only when the checks fail, not when they pass.
Yes, many packages that will have tests needing network access (and thus using skip_if_offline() will already depend directly or indirectly on the curl package and so not be bitten by this. But many will not, since networking is a feature of many R packages (and base R itself of course) that have no dependency on the R curl package. (I've hit this three times this week in separate packages -- for instance, arrow, duckdb, and the spatial packages binding gdal like terra, stars, sf, gdalcubes all provide network-based interfaces to remote data resources).
I think it might help to mention this in documentation. In general I think that's helpful for functions that pull in optional dependencies, especially when that function isn't used interactively. (In this case interactive testing doesn't help, since curl can be available on the host system but not the github actions tests).
Or perhaps the testthat::test_if_offline() should trigger a warning if curl is not available?
The text was updated successfully, but these errors were encountered:
The documentation for
test_if_offline()
doesn't mention that this function requires the optional dependency,curl
. Because of how skipping tests works and common patterns of use like r-lib/actions, this makes it easy to think tests are passing (i.e. gh-actions reports success) when in fact all tests that need network are being skipped because the package did not suggestcurl
in addition to suggestingtestthat
. I think I am not alone in not reading the testthat logs of every successful github action check, many of us look at logs closely only when the checks fail, not when they pass.Yes, many packages that will have tests needing network access (and thus using
skip_if_offline()
will already depend directly or indirectly on thecurl
package and so not be bitten by this. But many will not, since networking is a feature of many R packages (and base R itself of course) that have no dependency on the Rcurl
package. (I've hit this three times this week in separate packages -- for instance,arrow
,duckdb
, and the spatial packages binding gdal liketerra
,stars
,sf
,gdalcubes
all provide network-based interfaces to remote data resources).I think it might help to mention this in documentation. In general I think that's helpful for functions that pull in optional dependencies, especially when that function isn't used interactively. (In this case interactive testing doesn't help, since curl can be available on the host system but not the github actions tests).
Or perhaps the
testthat::test_if_offline()
should trigger a warning ifcurl
is not available?The text was updated successfully, but these errors were encountered: