From c285b35f2e2da5c9667c70556eb9469cf4ad73d2 Mon Sep 17 00:00:00 2001 From: Eric Scott Date: Wed, 29 Jan 2025 16:43:17 -0700 Subject: [PATCH] different way of skipping long tests (#43) --- tests/testthat/test-npn-geoserver.R | 4 +++- tests/testthat/test-npn-observations.R | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-npn-geoserver.R b/tests/testthat/test-npn-geoserver.R index eeec0c8..475bb0d 100755 --- a/tests/testthat/test-npn-geoserver.R +++ b/tests/testthat/test-npn-geoserver.R @@ -1,3 +1,5 @@ +skip_long_tests <- as.logical(Sys.getenv("RNPN_SKIP_LONG_TESTS", unset = "true")) + test_that("npn_get_layer_details works", { skip_on_cran() skip_if_not(check_geo_service(), "Geo Service is down") @@ -143,7 +145,7 @@ test_that("npn_get_agdd_point_data works",{ test_that("npn_get_custom_agdd_raster works", { skip_on_cran() - skip_if(get_skip_long_tests()) + skip_if(skip_long_tests) # skip_if_not(check_data_service(), "Data Service is down") res <- npn_get_custom_agdd_raster( diff --git a/tests/testthat/test-npn-observations.R b/tests/testthat/test-npn-observations.R index 83d81e9..7345562 100755 --- a/tests/testthat/test-npn-observations.R +++ b/tests/testthat/test-npn-observations.R @@ -4,7 +4,7 @@ # https://github.com/ropensci/vcr/issues/273 and # https://github.com/r-lib/httr2/issues/651 -skip_long_tests <- get_skip_long_tests() +skip_long_tests <- as.logical(Sys.getenv("RNPN_SKIP_LONG_TESTS", unset = "true")) test_that("no request source blocked", { skip_on_cran()