Skip to content

Conversation

llrs-roche
Copy link
Contributor

@llrs-roche llrs-roche commented Sep 11, 2025

Pull Request

Attempts to fix https://github.com/insightsengineering/coredev-tasks/issues/536 on this package.

  1. system.file don't raise an error (but I need to check if it is empty or it reports useful info).
  2. When there is an error on a shiny session the test of the example fails.
  3. Stop using load_all inside test-examples.
  4. Checks all examples due to upstream issues being fixed since last year.

For testing 2 create a new file and add a new file and document to add this example:

#' Example failing
#' @export
#' @examples
#' app <- init(
#' data = teal_data(
#'   new_iris = transform(iris, id = seq_len(nrow(iris))),
#'   new_mtcars = transform(mtcars, id = seq_len(nrow(mtcars)))
#' ),
#' modules = modules(
#'   module(
#'     "Iris Sepal.Length histogram",
#'     server = function(input, output, session, data) {
#'       stop("yada") # 🔍 this will fail the app
#'     },
#'     ui = function(id, ...) {
#'       ns <- NS(id)
#'       plotOutput(ns("hist"))
#'     },
#'     datanames = "new_iris"
#'   )
#' )
#' )
#' if (interactive()) {
#'   shinyApp(app$ui, app$server)
#' }
module_error <- function() {}

Then for all check with R CMD check or devtools::test(filter = "examples") from plain R session.

@llrs-roche llrs-roche changed the title Remove workarounds Address issues related to testing with shinytest2 the examples Sep 11, 2025
@llrs-roche llrs-roche marked this pull request as ready for review September 11, 2025 15:23
Copy link
Contributor

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  -------------------------------------------
R/tm_a_pca.R                    876     876  0.00%    141-1147
R/tm_a_regression.R             762     762  0.00%    180-1041
R/tm_data_table.R               200     200  0.00%    100-348
R/tm_file_viewer.R              172     172  0.00%    47-254
R/tm_front_page.R               143     132  7.69%    77-246
R/tm_g_association.R            331     331  0.00%    161-561
R/tm_g_bivariate.R              685     421  38.54%   332-805, 846, 957, 974, 992, 1003-1025
R/tm_g_distribution.R          1116    1116  0.00%    154-1414
R/tm_g_response.R               356     356  0.00%    179-608
R/tm_g_scatterplot.R            720     720  0.00%    261-1079
R/tm_g_scatterplotmatrix.R      283     264  6.71%    200-515, 576, 590
R/tm_missing_data.R            1099    1099  0.00%    124-1403
R/tm_outliers.R                1032    1032  0.00%    163-1348
R/tm_t_crosstable.R             273     273  0.00%    177-494
R/tm_variable_browser.R         788     783  0.63%    89-1025, 1063-1246
R/utils.R                       183     120  34.43%   87-249, 278-304, 316-325, 330, 344-363, 448
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9021    8659  4.01%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 16882da

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Sep 11, 2025

Unit Tests Summary

  1 files  23 suites   2s ⏱️
151 tests 36 ✅ 115 💤 0 ❌
194 runs  79 ✅ 115 💤 0 ❌

Results for commit 16882da.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant