insightsengineering / teal

Exploratory Web Apps for Analyzing Clinical Trial Data
https://insightsengineering.github.io/teal/
Other
168 stars 33 forks source link

Failed integration test #1195

Closed donyunardi closed 2 months ago

donyunardi commented 3 months ago

We got failed integration test and need to fix this:

* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > pkg_name <- "teal"
  > library(pkg_name, character.only = TRUE)
  Loading required package: shiny
  Loading required package: teal.data
  Loading required package: teal.code
  Loading required package: teal.slice
  Registered S3 method overwritten by 'teal':
    method        from      
    c.teal_slices teal.slice

  You are using teal version 0.15.2.9022

  Attaching package: 'teal'

  The following objects are masked from 'package:teal.slice':

      as.teal_slices, teal_slices

  > testthat::test_check(pkg_name)
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 479 ]

  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-shinytest2-filter_panel.R:48:3'): e2e: filtering a module-specific filter is refected in other shared module ──
  Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-shinytest2-filter_panel.R:48:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─app$get_active_data_filters("iris")
   5.   └─checkmate::assert_subset(dataset_name, datasets)
   6.     └─checkmate::makeAssertion(x, res, .var.name, add)
   7.       └─checkmate:::mstop(...)
  ── Error ('test-shinytest2-filter_panel.R:87:3'): e2e: filtering a module-specific filter is not refected in other unshared modules ──
  Error in `app$get_active_data_filters("mtcars")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-shinytest2-filter_panel.R:87:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─app$get_active_data_filters("mtcars")
   5.   └─checkmate::assert_subset(dataset_name, datasets)
   6.     └─checkmate::makeAssertion(x, res, .var.name, add)
   7.       └─checkmate:::mstop(...)
  ── Failure ('test-shinytest2-modules.R:49:3'): e2e: filter panel only shows the data supplied using datanames ──
  app$get_active_filter_vars() not identical to "mtcars".
  Lengths differ: 0 is not 1
  ── Failure ('test-shinytest2-modules.R:65:3'): e2e: filter panel shows all the datasets when datanames is all ──
  app$get_active_filter_vars() not identical to c("iris", "mtcars").
  Lengths differ: 0 is not 2
  ── Failure ('test-shinytest2-teal_data_module.R:32:3'): e2e: teal_data_module will have a delayed load of datasets ──
  app$get_active_filter_vars() (`actual`) and c("dataset1", "dataset2") (`expected`) don't have the same values.
  * Only in `actual`: "dataset1", "dataset2"

  ── Error ('test-shinytest2-teal_data_module.R:116:3'): e2e: teal_data_module inputs change teal_data object that is passed to teal main UI ──
  Error in `app$get_active_data_filters("dataset1")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.
  Backtrace:
      ▆
   1. ├─testthat::expect_setequal(...) at test-shinytest2-teal_data_module.R:116:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─app$get_active_data_filters("dataset1")
   5.   └─checkmate::assert_subset(dataset_name, datasets)
   6.     └─checkmate::makeAssertion(x, res, .var.name, add)
   7.       └─checkmate:::mstop(...)
  ── Error ('test-shinytest2-teal_slices.R:17:3'): e2e: teal_slices filters are initialized when global filters are created ──
  Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-shinytest2-teal_slices.R:17:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─app$get_active_data_filters("iris")
   5.   └─checkmate::assert_subset(dataset_name, datasets)
   6.     └─checkmate::makeAssertion(x, res, .var.name, add)
   7.       └─checkmate:::mstop(...)
  ── Error ('test-shinytest2-teal_slices.R:65:3'): e2e: teal_slices filters are initialized when module specific filters are created ──
  Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-shinytest2-teal_slices.R:65:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─app$get_active_data_filters("iris")
   5.   └─checkmate::assert_subset(dataset_name, datasets)
   6.     └─checkmate::makeAssertion(x, res, .var.name, add)
   7.       └─checkmate:::mstop(...)

  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 479 ]
  Error: Test failures
  Execution halted
Complete log ```r * using log directory ‘/builds/nest/automation/systems-integration-tests/teal.Rcheck’ * using R version 4.3.1 (2023-06-16) * using platform: x86_64-pc-linux-gnu (64-bit) * R was compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 * running under: Ubuntu 22.04.3 LTS * using session charset: UTF-8 * using option ‘--ignore-vignettes’ * checking for file ‘teal/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘teal’ version ‘0.15.2.9022’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘teal’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking startup messages can be suppressed ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking files in ‘vignettes’ ... SKIPPED * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > pkg_name <- "teal" > library(pkg_name, character.only = TRUE) Loading required package: shiny Loading required package: teal.data Loading required package: teal.code Loading required package: teal.slice Registered S3 method overwritten by 'teal': method from c.teal_slices teal.slice You are using teal version 0.15.2.9022 Attaching package: 'teal' The following objects are masked from 'package:teal.slice': as.teal_slices, teal_slices > testthat::test_check(pkg_name) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 479 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-shinytest2-filter_panel.R:48:3'): e2e: filtering a module-specific filter is refected in other shared module ── Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty. Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-shinytest2-filter_panel.R:48:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─app$get_active_data_filters("iris") 5. └─checkmate::assert_subset(dataset_name, datasets) 6. └─checkmate::makeAssertion(x, res, .var.name, add) 7. └─checkmate:::mstop(...) ── Error ('test-shinytest2-filter_panel.R:87:3'): e2e: filtering a module-specific filter is not refected in other unshared modules ── Error in `app$get_active_data_filters("mtcars")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty. Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-shinytest2-filter_panel.R:87:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─app$get_active_data_filters("mtcars") 5. └─checkmate::assert_subset(dataset_name, datasets) 6. └─checkmate::makeAssertion(x, res, .var.name, add) 7. └─checkmate:::mstop(...) ── Failure ('test-shinytest2-modules.R:49:3'): e2e: filter panel only shows the data supplied using datanames ── app$get_active_filter_vars() not identical to "mtcars". Lengths differ: 0 is not 1 ── Failure ('test-shinytest2-modules.R:65:3'): e2e: filter panel shows all the datasets when datanames is all ── app$get_active_filter_vars() not identical to c("iris", "mtcars"). Lengths differ: 0 is not 2 ── Failure ('test-shinytest2-teal_data_module.R:32:3'): e2e: teal_data_module will have a delayed load of datasets ── app$get_active_filter_vars() (`actual`) and c("dataset1", "dataset2") (`expected`) don't have the same values. * Only in `actual`: "dataset1", "dataset2" ── Error ('test-shinytest2-teal_data_module.R:116:3'): e2e: teal_data_module inputs change teal_data object that is passed to teal main UI ── Error in `app$get_active_data_filters("dataset1")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty. Backtrace: ▆ 1. ├─testthat::expect_setequal(...) at test-shinytest2-teal_data_module.R:116:3 2. │ └─testthat::quasi_label(enquo(object), arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─app$get_active_data_filters("dataset1") 5. └─checkmate::assert_subset(dataset_name, datasets) 6. └─checkmate::makeAssertion(x, res, .var.name, add) 7. └─checkmate:::mstop(...) ── Error ('test-shinytest2-teal_slices.R:17:3'): e2e: teal_slices filters are initialized when global filters are created ── Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty. Backtrace: ▆ 1. ├─testthat::expect_identical(...) at test-shinytest2-teal_slices.R:17:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─app$get_active_data_filters("iris") 5. └─checkmate::assert_subset(dataset_name, datasets) 6. └─checkmate::makeAssertion(x, res, .var.name, add) 7. └─checkmate:::mstop(...) ── Error ('test-shinytest2-teal_slices.R:65:3'): e2e: teal_slices filters are initialized when module specific filters are created ── Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty. Backtrace: ▆ 1. ├─testthat::expect_identical(...) at test-shinytest2-teal_slices.R:65:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─app$get_active_data_filters("iris") 5. └─checkmate::assert_subset(dataset_name, datasets) 6. └─checkmate::makeAssertion(x, res, .var.name, add) 7. └─checkmate:::mstop(...) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 479 ] Error: Test failures Execution halted * checking PDF version of manual ... OK * DONE Status: 1 ERROR See ‘/builds/nest/automation/systems-integration-tests/teal.Rcheck/00check.log’ for details. ```
donyunardi commented 3 months ago

I am not able to reproduce the failed tests locally. Waiting for the integration test to run again tonight.

Test Result ```r r$> devtools::test() ℹ Testing teal Registered S3 method overwritten by 'teal': method from c.teal_slices teal.slice [INFO] 2024-04-09 16:30:36.7901 pid:60637 token:[] teal You are using teal version 0.15.2.9022 ✔ | F W S OK | Context ✔ | 4 | filter_manager ✔ | 10 | init ✔ | 33 | module_nested_tabs [1.5s] ✔ | 8 | module_tabs_with_filters [1.6s] ✔ | 41 | module_teal_with_splash ✔ | 8 | module_teal ✔ | 95 | modules ✔ | 7 | rcode_utils ✔ | 5 | report_previewer_module ✔ | 5 | shinytest2-filter_panel [25.0s] ✔ | 17 | shinytest2-init [14.1s] ✔ | 11 | shinytest2-landing_popup [24.1s] ✔ | 4 | shinytest2-module_bookmark_manager [37.5s] ✔ | 6 | shinytest2-modules [22.4s] ✔ | 4 | shinytest2-reporter [55.5s] ✔ | 9 | shinytest2-show-rcode [5.2s] ✔ | 4 | shinytest2-teal_data_module [15.3s] ✔ | 18 | shinytest2-teal_slices [22.0s] ✔ | 4 | shinytest2-utils [4.8s] ✔ | 4 | shinytest2-wunder_bar [10.3s] ✔ | 2 | snapshot_manager ✔ | 41 | tdata [7.8s] ✔ | 16 | teal_data_module-eval_code ✔ | 3 | teal_data_module ✔ | 25 | teal_reporter ✔ | 15 | teal_slices-store ✔ | 18 | teal_slices ✔ | 35 | utils ✔ | 17 | validate_has_data ✔ | 36 | validate_inputs ══ Results ═════════════════════════════════════════════════════════════════════════════════════════════════════════════ Duration: 253.5 s [ FAIL 0 | WARN 0 | SKIP 0 | PASS 505 ] ```
R CMD check ```r r$> devtools::check() ══ Documenting ═════════════════════════════════════════════════════════════════════════════════════════════════════════ ℹ Updating teal documentation ℹ Loading teal [INFO] 2024-04-09 16:37:18.4871 pid:60637 token:[] teal You are using teal version 0.15.2.9022 ══ Building ════════════════════════════════════════════════════════════════════════════════════════════════════════════ Setting env vars: • CFLAGS : -Wall -pedantic -fdiagnostics-color=always • CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always • CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always ── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file ‘/Users/unardid/Documents/dsx/insightengineering/teal/DESCRIPTION’ ... ─ preparing ‘teal’: (1.8s) ✔ checking DESCRIPTION meta-information ... ─ installing the package to build vignettes ✔ creating vignettes (14.6s) ─ checking for LF line-endings in source and make files and shell scripts (475ms) ─ checking for empty or unneeded directories Omitted ‘LazyData’ from DESCRIPTION ─ building ‘teal_0.15.2.9022.tar.gz’ ══ Checking ════════════════════════════════════════════════════════════════════════════════════════════════════════════ Setting env vars: • _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE • _R_CHECK_CRAN_INCOMING_ : FALSE • _R_CHECK_FORCE_SUGGESTS_ : FALSE • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE • NOT_CRAN : true ── R CMD check ───────────────────────────────────────────────────────────────────────────────────────────────────────── ─ using log directory ‘/private/var/folders/2q/3msvdr052rbctgldyf85xy240000gp/T/RtmpWddlVA/fileecdd60af8f33/teal.Rcheck’ ─ using R version 4.3.3 (2024-02-29) ─ using platform: x86_64-apple-darwin20 (64-bit) ─ R was compiled by Apple clang version 14.0.0 (clang-1400.0.29.202) GNU Fortran (GCC) 12.2.0 ─ running under: macOS Ventura 13.6.3 ─ using session charset: UTF-8 ─ using options ‘--no-manual --as-cran’ (428ms) ✔ checking for file ‘teal/DESCRIPTION’ ─ checking extension type ... Package ─ this is package ‘teal’ version ‘0.15.2.9022’ ─ package encoding: UTF-8 ✔ checking package namespace information ... ✔ checking package dependencies (4s) ✔ checking if this is a source package ... ✔ checking if there is a namespace ... ✔ checking for executable files (2s) ✔ checking for hidden files and directories ... ✔ checking for portable file names ... ✔ checking for sufficient/correct file permissions ... ✔ checking whether package ‘teal’ can be installed (8s) ✔ checking installed package size ... ✔ checking package directory ... ✔ checking for future file timestamps (514ms) ✔ checking ‘build’ directory ✔ checking DESCRIPTION meta-information (351ms) ✔ checking top-level files ... ✔ checking for left-over files ✔ checking index information ... ✔ checking package subdirectories (562ms) ✔ checking R files for non-ASCII characters ... ✔ checking R files for syntax errors ... ✔ checking whether the package can be loaded (926ms) ✔ checking whether the package can be loaded with stated dependencies (922ms) ✔ checking whether the package can be unloaded cleanly (849ms) ✔ checking whether the namespace can be loaded with stated dependencies (764ms) ✔ checking whether the namespace can be unloaded cleanly (832ms) ✔ checking startup messages can be suppressed (1.7s) ✔ checking dependencies in R code (1s) ✔ checking S3 generic/method consistency (1s) ✔ checking replacement functions (695ms) ✔ checking foreign function calls (1.1s) ✔ checking R code for possible problems (8.6s) ✔ checking Rd files (880ms) ✔ checking Rd metadata ... ✔ checking Rd line widths ... ✔ checking Rd cross-references ... ✔ checking for missing documentation entries (906ms) ✔ checking for code/documentation mismatches (2.7s) ✔ checking Rd \usage sections (1.6s) ✔ checking Rd contents ... ✔ checking for unstated dependencies in examples (420ms) ✔ checking installed files from ‘inst/doc’ ... ✔ checking files in ‘vignettes’ ... ✔ checking examples (3.4s) ✔ checking for unstated dependencies in ‘tests’ (343ms) ─ checking tests ... [16s/17s] OKthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... [13s/14s] OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: OK ── R CMD check results ─────────────────────────────────────────────────────────────────────────── teal 0.15.2.9022 ──── Duration: 1m 18.8s 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ ```
Session Info ```r r$> sessionInfo() R version 4.3.3 (2024-02-29) Platform: x86_64-apple-darwin20 (64-bit) Running under: macOS Ventura 13.6.3 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: America/Los_Angeles tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] teal_0.15.2.9022 rvest_1.0.4 shinytest2_0.3.1 teal.slice_0.5.0.9010 teal.data_0.5.0.9007 [6] teal.code_0.5.0.9004 shiny_1.8.1.1 testthat_3.2.1 BiocManager_1.30.22 loaded via a namespace (and not attached): [1] bitops_1.0-7 formatR_1.14 remotes_2.5.0 logger_0.3.0 [5] rlang_1.1.3 magrittr_2.0.3 matrixStats_1.2.0 compiler_4.3.3 [9] roxygen2_7.3.1 callr_3.7.6 vctrs_0.6.5 stringr_1.5.1 [13] profvis_0.3.8 pkgconfig_2.0.3 crayon_1.5.2 fastmap_1.1.1 [17] backports_1.4.1 XVector_0.42.0 ellipsis_0.3.2 fontawesome_0.5.2 [21] utf8_1.2.4 promises_1.3.0 rmarkdown_2.26 sessioninfo_1.2.2 [25] ps_1.7.6 purrr_1.0.2 waldo_0.5.2 xfun_0.43 [29] MultiAssayExperiment_1.28.0 shinyvalidate_0.1.3 zlibbioc_1.48.2 cachem_1.0.8 [33] teal.reporter_0.3.1.9003 GenomeInfoDb_1.38.8 jsonlite_1.8.8 later_1.3.2 [37] DelayedArray_0.28.0 prettyunits_1.2.0 R6_2.5.1 bslib_0.7.0 [41] stringi_1.8.3 pkgload_1.3.4 brio_1.1.4 GenomicRanges_1.54.1 [45] jquerylib_0.1.4 Rcpp_1.0.12 SummarizedExperiment_1.32.0 knitr_1.46 [49] usethis_2.2.3 teal.logger_0.2.0.9001 IRanges_2.36.0 Matrix_1.6-5 [53] httpuv_1.6.15 tidyselect_1.2.1 abind_1.4-5 rstudioapi_0.16.0 [57] yaml_2.3.8 codetools_0.2-20 miniUI_0.1.1.1 websocket_1.4.1 [61] curl_5.2.1 processx_3.8.4 teal.widgets_0.4.2.9009 pkgbuild_1.4.4 [65] lattice_0.22-6 tibble_3.2.1 Biobase_2.62.0 withr_3.0.0 [69] evaluate_0.23 desc_1.4.3 urlchecker_1.0.1 xml2_1.3.6 [73] pillar_1.9.0 MatrixGenerics_1.14.0 checkmate_2.3.1 stats4_4.3.3 [77] shinyjs_2.1.0 pingr_2.0.3 generics_0.1.3 xopen_1.0.0 [81] rprojroot_2.0.4 RCurl_1.98-1.14 chromote_0.2.0 S4Vectors_0.40.2 [85] commonmark_1.9.1 globals_0.16.3 xtable_1.8-4 glue_1.7.0 [89] tools_4.3.3 fs_1.6.3 grid_4.3.3 devtools_2.4.5 [93] GenomeInfoDbData_1.2.11 cli_3.6.2 rcmdcheck_1.4.0 fansi_1.0.6 [97] S4Arrays_1.2.1 dplyr_1.1.4 selectr_0.4-2 sass_0.4.9 [101] digest_0.6.35 BiocGenerics_0.48.1 SparseArray_1.2.4 htmlwidgets_1.6.4 [105] memoise_2.0.1 htmltools_0.5.8.1 lifecycle_1.0.4 httr_1.4.7 [109] shinyWidgets_0.8.4 mime_0.12 ```
donyunardi commented 3 months ago

The integration test just ran and it failed with the same error message as in the original post. I still can't replicate the error locally.

@insightsengineering/nest-core-dev Can someone else try to replicate this?

kartikeyakirar commented 3 months ago

I am also unable to reproduce it locally. All the tests are passing.

image

vedhav commented 3 months ago

It passes for me too. My intuition is that it takes a while after the app$click("teal_data_module-submit") to load the teal app. It passes locally in our machines but the CI that runs these tests have limited resources so it fails. Once we add a wait_for_idle call it could fix it. Let me try to simulate this with less resources.

vedhav commented 3 months ago

Note that we do a wait call in our TealAppDriver$click by default. However, it's default wait time is 500 ms which might be less for a teal_data_module init.

m7pr commented 3 months ago

I always add $wait_for_idle after every $click! I though we have extended the $click() method so it also has $wait_for_idle in it.

https://github.com/insightsengineering/teal/blob/a5e08a6a4854a140649442adf47fa3cfe7c1c522/R/TealAppDriver.R#L71-L77

Maybe we should extend the defaults in this method as well?

donyunardi commented 3 months ago

Maybe we should extend the defaults in this method as well? Yes. Let's do 5000.

I'll prep the PR.

pawelru commented 3 months ago

If you are stuck then you can add debug logs and try to understand the processing from these

donyunardi commented 3 months ago

The integration still fails with the same error message.

All the error message has similar issue and it boils down to this method app$get_active_filter_vars(). https://github.com/insightsengineering/teal/blob/1de78ee3ad70858aee6ef78d188be207b010bf17/R/TealAppDriver.R#L241-L253

This method always returns empty during integration test.

We can see it from the assertion failure here:

  ── Error ('test-shinytest2-filter_panel.R:48:3'): e2e: filtering a module-specific filter is refected in other shared module ──
  Error in `app$get_active_data_filters("iris")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.

  ── Error ('test-shinytest2-filter_panel.R:87:3'): e2e: filtering a module-specific filter is not refected in other unshared modules ──
  Error in `app$get_active_data_filters("mtcars")`: Assertion on 'dataset_name' failed: Must be a subset of the empty set, i.e. also empty.

(get_active_data_filters calls get_active_filter_vars() and then assert the result: https://github.com/insightsengineering/teal/blob/1de78ee3ad70858aee6ef78d188be207b010bf17/R/TealAppDriver.R#L288-L291

and here:

  ── Failure ('test-shinytest2-modules.R:49:3'): e2e: filter panel only shows the data supplied using datanames ──
  app$get_active_filter_vars() not identical to "mtcars".
  Lengths differ: 0 is not 1
  ── Failure ('test-shinytest2-modules.R:65:3'): e2e: filter panel shows all the datasets when datanames is all ──
  app$get_active_filter_vars() not identical to c("iris", "mtcars").
  Lengths differ: 0 is not 2
  ── Failure ('test-shinytest2-teal_data_module.R:32:3'): e2e: teal_data_module will have a delayed load of datasets ──

This suggests that during the integration test, it's unable to locate the required CSS/HTML needed, therefore it's returning empty value. I'm not entirely sure why, but perhaps we should log the value of each object in that method and print it out.

I'll prepare the PR for now, but please feel free to chime in if this leads to another clue.