-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
239 utilize logger::log_shiny_input_change
#382
Conversation
Merge branch 'main' of https://github.com/insightsengineering/teal.modules.hermes # Conflicts: # R/km.R # man/tm_g_km.Rd
CLA Assistant Lite bot ✅ All contributors have signed the CLA |
Hi @danielinteractive just checking if this is ok with you to provide such logging for all shiny input changes? |
I have read the CLA Document and I hereby sign the CLA |
recheck |
Unit Tests Summary 1 files 15 suites 8s ⏱️ Results for commit 4e3fb2d. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 3ffd19f ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @m7pr , lgtm
@pawelru check out tests failining here after introducing library(shiny)
server <- function(input, output, session) {
logger::log_shiny_input_changes()
x <- reactive(input$a * input$b)
}
testServer(server, {
session$setInputs(a = 2, b = 3)
stopifnot(x() == 6)
})
Error in logger::log_shiny_input_changes() :
No Shiny app running, it makes no sense to call this function outside of a Shiny app |
Hmmm... Very interesting finding. Looks that the core functionality is not prepared for handling the test. Please have a look at this: https://github.com/daroczig/logger/blob/2ff43d0cb87b0c0e896a165fdec20ca290a9142c/R/hooks.R#L149-L151 Can you prepare a PR that could enhance it? This and assume it got merged (and released) soon. Unfortunately I don't have control on this. In the past it took a while to get this completed but last time it was very smooth one. |
Hey @pawelru I created a PR in |
Created an alternative PR that handles shiny in testing mode daroczig/logger#155 |
For our case then I think we need to change logger::log_shiny_input_changes(input, namespace = "teal.modules.hermes") into if (shiny:isRunning()) {
logger::log_shiny_input_changes(input, namespace = "teal.modules.hermes")
} Once daroczig/logger#155 is merged, we can remove |
Code Coverage Summary
Diff against main
Results for commit: 4e3fb2d Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Created an issue, for the future, to keep in mind that the if statement might not be needed anymore at some point #383 |
Similar to
insightsengineering/teal.modules.general#750
insightsengineering/teal.modules.clinical#227