diff --git a/tests/testthat/helper-profvis.R b/tests/testthat/helper-profvis.R index 11234e69..98760ef4 100644 --- a/tests/testthat/helper-profvis.R +++ b/tests/testthat/helper-profvis.R @@ -25,9 +25,3 @@ profvis_modal_value <- function(prof) { stacks <- vapply(stacks, paste, "", collapse = " ") modal_value0(stacks) } - -skip_on_cran_if_not_ci <- function() { - if (!is_true(as.logical(Sys.getenv("CI")))) { - skip_on_cran() - } -} diff --git a/tests/testthat/test-profvis.R b/tests/testthat/test-profvis.R index 12f0fbc1..7a74f631 100644 --- a/tests/testthat/test-profvis.R +++ b/tests/testthat/test-profvis.R @@ -1,7 +1,6 @@ - -skip_on_cran_if_not_ci() - test_that("Irrelevant stack is trimmed from profiles (#123)", { + skip_on_cran() + f <- function() pause(TEST_PAUSE_TIME) out <- repro_profvis(f(), simplify = FALSE) diff --git a/tests/testthat/test-rprof.R b/tests/testthat/test-rprof.R index 8774f593..a4f8bf9e 100644 --- a/tests/testthat/test-rprof.R +++ b/tests/testthat/test-rprof.R @@ -1,7 +1,6 @@ -skip_on_cran_if_not_ci() - test_that("`rprof_lines()` collects profiles", { + skip_on_cran() f <- function() pause(TEST_PAUSE_TIME) out <- rprof_lines(f(), rerun = "pause") @@ -11,6 +10,7 @@ test_that("`rprof_lines()` collects profiles", { }) test_that("`filter.callframes` filters out intervening frames", { + skip_on_cran() skip_if_not(has_simplify()) # Chains of calls are kept @@ -25,6 +25,7 @@ test_that("`filter.callframes` filters out intervening frames", { }) test_that("stack is correctly stripped even with metadata profiling", { + skip_on_cran() f <- function() pause(TEST_PAUSE_TIME) zap <- function(lines) modal_value0(zap_trailing_space(zap_srcref(zap_meta_data(lines)))) @@ -48,6 +49,7 @@ test_that("stack is correctly stripped even with metadata profiling", { }) test_that("`pause()` does not include .Call() when `line.profiling` is set", { + skip_on_cran() f <- function() pause(TEST_PAUSE_TIME) # `pause()` should appear first on the line @@ -56,6 +58,7 @@ test_that("`pause()` does not include .Call() when `line.profiling` is set", { }) test_that("srcrefs do not prevent suffix replacement", { + skip_on_cran() line <- ":1509169:3184799:91929040:0:\"pause\" 1#1 \"f\" \"doTryCatch\" \"tryCatchOne\" \"tryCatchList\" \"doTryCatch\" \"tryCatchOne\" \"tryCatchList\" \"tryCatch\" 2#193 \"with_profvis_handlers\" 2#151 \"profvis\" " suffix <- "\"doTryCatch\" \"tryCatchOne\" \"tryCatchList\" \"doTryCatch\" \"tryCatchOne\" \"tryCatchList\" \"tryCatch\" 2#193 \"with_profvis_handlers\" 2#151 \"profvis\" $" re <- gsub_srcref_as_wildcards(suffix)