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
@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2025

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                       185     120  35.14%   87-249, 278-304, 316-325, 330, 344-363, 452
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9023    8659  4.03%

Diff against main

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

Results for commit: bb0d111

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
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 bb0d111.

♻️ This comment has been updated with latest results.

@llrs-roche
Copy link
Contributor Author

Hi team @insightsengineering/nest-core-dev . Can someone check this PR?

@m7pr m7pr self-requested a review September 23, 2025 09:30
@m7pr m7pr self-assigned this Sep 23, 2025
Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R CMD does not raise errors

── R CMD check results ──────────────────────────────────────────────────────────────── teal.modules.general 0.5.0.9002 ────
Duration: 2m 26.9schecking whether package 'teal.modules.general' can be installed ... [13s] WARNING
  See below...checking package dependencies ... NOTE
  Imports includes 34 non-default packages.
  Importing from so many packages makes the package vulnerable to any of
  them becoming unavailable.  Move as many as possible to Suggests and
  use conditionally.checking for future file timestamps ... NOTE
  unable to verify current time

0 errors

@llrs-roche llrs-roche merged commit f60963c into main Sep 23, 2025
26 checks passed
@llrs-roche llrs-roche deleted the 536_fix_shinytest2@main branch September 23, 2025 09:39
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants