Skip to content

Commit

Permalink
skip gdal calc tests on macos
Browse files Browse the repository at this point in the history
- this is because there seems to be issue with temp dirs on github actions mac runners
  • Loading branch information
jeffreyhanson committed Jul 22, 2024
1 parent 6937073 commit ee2fe74
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/terra_gdal_calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ terra_gdal_calc <- function(x, expr,
file.exists(filename),
msg = paste0(
"failed to run `gdal_calc.py` script: output file \"",
filename, "\ does not exist"
filename, "\" does not exist"
)
)

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_create_spp_aoh_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ test_that("simulated data (GDAL engine)", {
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_on_os("mac")
# specify file path
f <- system.file("testdata", "SIMULATED_SPECIES.zip", package = "aoh")
elevation_data <- terra::rast(
Expand Down Expand Up @@ -549,6 +550,7 @@ test_that("small range data (rasterize_touches, engine = gdal)", {
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_on_os("mac")
# specify file path
f <- system.file("testdata", "SIMULATED_SPECIES.zip", package = "aoh")
elevation_data <- terra::rast(
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test_create_spp_frc_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ test_that("different engines produce same result", {
# skip if needed
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_if_gdal_calc_not_available()\
skip_on_os("mac")
# specify file path
f <- system.file("testdata", "SIMULATED_SPECIES.zip", package = "aoh")
elevation_data <- terra::rast(
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test_terra_gdal_calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ test_that("single layer (in memory)", {
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_on_os("mac")
# create data
x <- terra::rast(
ncols = 40, nrows = 40, xmin = -110, xmax = -90, ymin = 40, ymax = 60,
Expand All @@ -23,6 +24,7 @@ test_that("two layers", {
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_on_os("mac")
# create data
x <- terra::rast(
ncols = 40, nrows = 40, xmin = -110, xmax = -90, ymin = 40, ymax = 60,
Expand All @@ -43,6 +45,7 @@ test_that("three layers (in memory)", {
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_on_os("mac")
# create data
x <- terra::rast(
ncols = 40, nrows = 40, xmin = -110, xmax = -90, ymin = 40, ymax = 60,
Expand All @@ -66,6 +69,7 @@ test_that("three layers (on disk)", {
skip_on_cran()
skip_if_not_installed("gdalUtilities")
skip_if_gdal_calc_not_available()
skip_on_os("mac")
# create paths
f1 <- tempfile(fileext = ".tif")
f2 <- tempfile(fileext = ".tif")
Expand Down

0 comments on commit ee2fe74

Please sign in to comment.