Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/testthat/helper-live.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Helper to skip tests that require live internet downloads unless explicitly enabled.
# File loaded by testthat when its name starts with "helper-".
skip_if_no_live_tests <- function() {
if (!identical(tolower(Sys.getenv("EPATADA_RUN_LIVE_TESTS", "")), "true")) {
testthat::skip(
"Live reference tests disabled in CI; set EPATADA_RUN_LIVE_TESTS=true to enable"
)
}
if (!requireNamespace("curl", quietly = TRUE) || !curl::has_internet()) {
testthat::skip("No internet connection available for live reference tests")
}
}
5 changes: 5 additions & 0 deletions tests/testthat/test-WQPWQXATTAINSCSTRefs.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ testthat::test_that("df_equal ignores row order and factor levels", {

testthat::test_that("Is TADA_GetDetCondRef up to date?", {
skip_on_cran()
skip_if_no_live_tests()

file_path <- system.file(
"extdata",
Expand Down Expand Up @@ -102,6 +103,7 @@ testthat::test_that("Is TADA_GetDetCondRef up to date?", {

testthat::test_that("Is TADA_GetDetLimitRef up to date?", {
skip_on_cran()
skip_if_no_live_tests()

file_path <- system.file(
"extdata",
Expand Down Expand Up @@ -130,6 +132,7 @@ testthat::test_that("Is TADA_GetDetLimitRef up to date?", {

testthat::test_that("Is TADA_GetActivityTypeRef up to date?", {
skip_on_cran()
skip_if_no_live_tests()

file_path <- system.file(
"extdata",
Expand Down Expand Up @@ -158,6 +161,7 @@ testthat::test_that("Is TADA_GetActivityTypeRef up to date?", {

testthat::test_that("Is TADA_GetMeasureQualifierCodeRef up to date?", {
skip_on_cran()
skip_if_no_live_tests()

file_path <- system.file(
"extdata",
Expand Down Expand Up @@ -189,6 +193,7 @@ testthat::test_that("Is TADA_GetMeasureQualifierCodeRef up to date?", {

testthat::test_that("Is TADA_GetWQXCharAliasRef more than 1 month old?", {
testthat::skip_on_cran()
skip_if_no_live_tests()

file_path <- system.file(
"extdata",
Expand Down
Loading