Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed integration test #1195

Closed
donyunardi opened this issue Apr 9, 2024 · 9 comments
Closed

Failed integration test #1195

donyunardi opened this issue Apr 9, 2024 · 9 comments
Assignees
Labels

Comments

@donyunardi
Copy link
Contributor

We got failed integration test and need to fix this:

* checking tests ...
  Runningtestthat.RERROR
Running the tests intests/testthat.Rfailed.
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
* 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 fileteal/DESCRIPTION... OK
* checking extension type ... Package
* this is packagetealversion0.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 packagetealcan 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 invignettes... SKIPPED
* checking examples ... OK
* checking for unstated dependencies intests... OK
* checking tests ...
  Runningtestthat.RERROR
Running the tests intests/testthat.Rfailed.
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 donyunardi added the core label Apr 9, 2024
@donyunardi donyunardi self-assigned this Apr 9, 2024
@donyunardi
Copy link
Contributor Author

donyunardi commented Apr 9, 2024

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

Test Result
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$> devtools::check()
══ Documenting ═════════════════════════════════════════════════════════════════════════════════════════════════════════
ℹ Updating teal documentationLoading 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=alwaysCXXFLAGS  : -Wall -pedantic -fdiagnostics-color=alwaysCXX11FLAGS: -Wall -pedantic -fdiagnostics-color=alwaysCXX14FLAGS: -Wall -pedantic -fdiagnostics-color=alwaysCXX17FLAGS: -Wall -pedantic -fdiagnostics-color=alwaysCXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file/Users/unardid/Documents/dsx/insightengineering/teal/DESCRIPTION...preparingteal: (1.8s)
✔  checking DESCRIPTION meta-information ...installing the package to build vignettescreating vignettes (14.6s)
─  checking for LF line-endings in source and make files and shell scripts (475ms)
─  checking for empty or unneeded directories
   OmittedLazyDatafrom DESCRIPTIONbuildingteal_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_: FALSENOT_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.0running under: macOS Ventura 13.6.3using session charset: UTF-8using options--no-manual --as-cran’ (428ms)
✔  checking for fileteal/DESCRIPTION’
─  checking extension type ... Packagethis is packagetealversion0.15.2.9022’
─  package encoding: UTF-8checking 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 packagetealcan be installed (8s)
✔  checking installed package size ...checking package directory ...checking for future file timestamps (514ms)
✔  checkingbuilddirectorychecking DESCRIPTION meta-information (351ms)
✔  checking top-level files ...checking for left-over fileschecking 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 frominst/doc...checking files invignettes...checking examples (3.4s)
✔  checking for unstated dependencies intests’ (343ms)
─  checking tests ...
    [16s/17s] OKthat.R* checking for unstated dependencies in vignettes ... OK
   * checking package vignettes ininst/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$> 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
Copy link
Contributor Author

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
Copy link
Contributor

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

image

@vedhav
Copy link
Contributor

vedhav commented Apr 10, 2024

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
Copy link
Contributor

vedhav commented Apr 10, 2024

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
Copy link
Contributor

m7pr commented Apr 10, 2024

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.

teal/R/TealAppDriver.R

Lines 71 to 77 in a5e08a6

#' @description
#' Append parent [`shinytest2::AppDriver`] `click` method with a call to `waif_for_idle()` method.
#' @param ... arguments passed to parent [`shinytest2::AppDriver`] `click()` method.
click = function(...) {
super$click(...)
self$wait_for_idle()
},

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

@donyunardi
Copy link
Contributor Author

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

I'll prep the PR.

donyunardi added a commit that referenced this issue Apr 11, 2024
@pawelru
Copy link
Contributor

pawelru commented Apr 11, 2024

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

@donyunardi
Copy link
Contributor Author

donyunardi commented Apr 12, 2024

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().

teal/R/TealAppDriver.R

Lines 241 to 253 in 1de78ee

get_active_filter_vars = function() {
displayed_datasets_index <- self$is_visible(
sprintf("#%s-active-filter_active_vars_contents > span", self$active_filters_ns())
)
available_datasets <- self$get_text(
sprintf(
"#%s-active-filter_active_vars_contents .filter_panel_dataname",
self$active_filters_ns()
)
)
available_datasets[displayed_datasets_index]
},

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:

teal/R/TealAppDriver.R

Lines 288 to 291 in 1de78ee

get_active_data_filters = function(dataset_name = NULL) {
checkmate::check_string(dataset_name, null.ok = TRUE)
datasets <- self$get_active_filter_vars()
checkmate::assert_subset(dataset_name, datasets)

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.

@averissimo averissimo self-assigned this Apr 19, 2024
averissimo added a commit that referenced this issue Apr 23, 2024
Related to #1195 

I'm focusing on `test-shinytest2-filter_panel` to gain more insight
during the integration test.

#### Changes description

- Use alternative method of checking visibility of element when
`el.checkVisibility()` method does not exists (is `null`)
- Fix tests that were relying on the order of unordered filters
(categorical)
  - `expect_setequal` instead of `expect_equal` to compare vectors.

---------

Co-authored-by: André Veríssimo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants