From 445671028e0bc28bf8b7f4843309ed54a1fdbc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:24:00 +0200 Subject: [PATCH 1/2] fix: use globals hint to load tmc on test-examples --- tests/testthat/test-examples.R | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/testthat/test-examples.R b/tests/testthat/test-examples.R index 601cb269a6..6695f50c86 100644 --- a/tests/testthat/test-examples.R +++ b/tests/testthat/test-examples.R @@ -38,12 +38,7 @@ with_mocked_app_bindings <- function(code) { # change to `print(shiny__shinyApp(...))` and remove allow warning once fixed mocked_shinyApp <- function(ui, server, ...) { # nolint object_name_linter. functionBody(server) <- bquote({ - pkgload::load_all( - .(normalizePath(file.path(testthat::test_path(), "..", ".."))), - export_all = FALSE, - attach_testthat = FALSE, - warn_conflicts = FALSE - ) + .hint_to_load_package <- tm_g_ci # Hint to shinytest2 when looking for packages in globals .(functionBody(server)) }) print(do.call(shiny__shinyApp, append(x = list(ui = ui, server = server), list(...)))) @@ -114,7 +109,9 @@ strict_exceptions <- c( "tm_g_ci.Rd", "tm_g_ipp.Rd", "tm_g_pp_adverse_events.Rd", - "tm_g_pp_vitals.Rd" + "tm_g_pp_vitals.Rd", + "tm_t_shift_by_arm.Rd", + "tm_t_summary_by.Rd" ) for (i in rd_files()) { From 6586736d30b92e01273c08abbe3224c09d3c45c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:28:26 +0200 Subject: [PATCH 2/2] temporary: comment out skip_on_cran --- tests/testthat/test-examples.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-examples.R b/tests/testthat/test-examples.R index 6695f50c86..6c8784d501 100644 --- a/tests/testthat/test-examples.R +++ b/tests/testthat/test-examples.R @@ -118,7 +118,7 @@ for (i in rd_files()) { testthat::test_that( paste0("example-", basename(i)), { - testthat::skip_on_cran() + # testthat::skip_on_cran() if (basename(i) %in% strict_exceptions) { op <- options() withr::local_options(opts_partial_match_old)