Skip to content

Commit

Permalink
Merge pull request #85 from dieghernan/main
Browse files Browse the repository at this point in the history
Fix covr
  • Loading branch information
dieghernan authored Nov 16, 2022
2 parents 2e975fe + d23324c commit c40dc8d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: test-coverage

jobs:
test-coverage:
runs-on: macos-latest
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

Expand Down
46 changes: 23 additions & 23 deletions tests/testthat/test-esp_getTiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-layer_spatraster.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down

0 comments on commit c40dc8d

Please sign in to comment.