diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 0c3b41cb..be7994ce 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -10,7 +10,7 @@ name: test-coverage jobs: test-coverage: - runs-on: macos-latest + runs-on: windows-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/testthat/test-esp_getTiles.R b/tests/testthat/test-esp_getTiles.R index 212f30e7..333be0ac 100644 --- a/tests/testthat/test-esp_getTiles.R +++ b/tests/testthat/test-esp_getTiles.R @@ -20,7 +20,7 @@ test_that("tiles online", { # Skip test as tiles sometimes are not available skip_on_cran() - skip_on_ci() + skip_on_os(c("mac", "linux")) skip_if_offline() save_png <- function(code, width = 200, height = 200) { @@ -69,26 +69,6 @@ test_that("tiles online", { type = "IGNBase.Orto" )) - # Single point - point <- esp_get_ccaa("Madrid") - point <- sf::st_transform(point, 3857) - - point <- sf::st_centroid( - sf::st_geometry(point), - of_largest_polygon = TRUE - ) - - expect_length(point, 1) - expect_s3_class(point, "sfc_POINT") - - expect_message(esp_getTiles(point, - verbose = TRUE - )) - - p <- esp_getTiles(point, verbose = TRUE) - - - expect_message(esp_getTiles(poly, type = "RedTransporte.Carreteras", verbose = TRUE, mask = TRUE @@ -131,6 +111,26 @@ test_that("tiles online", { # Run only locally skip_on_ci() + + # Single point + point <- esp_get_ccaa("Madrid") + point <- sf::st_transform(point, 3857) + + point <- sf::st_centroid( + sf::st_geometry(point), + of_largest_polygon = TRUE + ) + + expect_length(point, 1) + expect_s3_class(point, "sfc_POINT") + + expect_message(esp_getTiles(point, + verbose = TRUE + )) + + p <- esp_getTiles(point, verbose = TRUE) + + expect_snapshot_file(save_png(opaque), "opaque.png") expect_snapshot_file(save_png(n), "transp.png") @@ -149,7 +149,7 @@ test_that("tiles masks and crops", { # Skip test as tiles sometimes are not available skip_on_cran() - skip_on_ci() + skip_on_os(c("mac", "linux")) skip_if_offline() poly <- esp_get_ccaa("La Rioja", epsg = 4326) @@ -184,7 +184,7 @@ test_that("tiles options", { # Skip test as tiles sometimes are not available skip_on_cran() - skip_on_ci() + skip_on_os(c("mac", "linux")) skip_if_offline() poly <- esp_get_capimun(munic = "^Toledo", epsg = 3857) diff --git a/tests/testthat/test-layer_spatraster.R b/tests/testthat/test-layer_spatraster.R index 538d6223..a2479b6e 100644 --- a/tests/testthat/test-layer_spatraster.R +++ b/tests/testthat/test-layer_spatraster.R @@ -15,7 +15,6 @@ test_that("Test layers", { # Skip test as tiles sometimes are not available skip_on_cran() - skip_on_ci() skip_if_offline()