Skip to content

Commit

Permalink
Skip tests on code coverage (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Jul 2, 2024
1 parent e035176 commit 6df7759
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/testthat/test-profvis.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
test_that("Irrelevant stack is trimmed from profiles (#123)", {
skip_on_cran()
skip_on_covr()

f <- function() pause(TEST_PAUSE_TIME)

Expand Down
8 changes: 7 additions & 1 deletion tests/testthat/test-rprof.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

test_that("`rprof_lines()` collects profiles", {
skip_on_cran()
skip_on_covr()

f <- function() pause(TEST_PAUSE_TIME)

out <- rprof_lines(f(), rerun = "pause")
Expand All @@ -11,6 +13,7 @@ test_that("`rprof_lines()` collects profiles", {

test_that("`filter.callframes` filters out intervening frames", {
skip_on_cran()
skip_on_covr()
skip_if_not(has_simplify())

# Chains of calls are kept
Expand All @@ -26,6 +29,8 @@ test_that("`filter.callframes` filters out intervening frames", {

test_that("stack is correctly stripped even with metadata profiling", {
skip_on_cran()
skip_on_covr()

f <- function() pause(TEST_PAUSE_TIME)
zap <- function(lines) modal_value0(zap_trailing_space(zap_srcref(zap_meta_data(lines))))

Expand All @@ -50,6 +55,8 @@ 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()
skip_on_covr()

f <- function() pause(TEST_PAUSE_TIME)

# `pause()` should appear first on the line
Expand All @@ -58,7 +65,6 @@ 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)
Expand Down

0 comments on commit 6df7759

Please sign in to comment.