-
Notifications
You must be signed in to change notification settings - Fork 46
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
Use session
in log_shiny_input_changes
to detect testing environment and utilize namespaces for more informative logging
#155
Conversation
…Environment and Namespaces
session
to log_shiny_input_changes
to detect Testing Environment and Namespacessession
in log_shiny_input_changes
to detect testing environment and utilize namespaces for more informative logging
CCing @daroczig for visibility |
Thanks a ton, looks very promising! Could you please take a look at the failing unit tests? |
@daroczig sure, just made one change, can you approve workflows to run again? |
CC @daroczig sure, just made one change, can you approve workflows to run again? |
sorry for the delay with getting back to this 🤦 I've rerun the unit tests, but seeing the same error:
can you please update the related unit test(s)? |
Sorry @daroczig for the delay. I fixed the mentioned test. |
since then, we switched using snapshots for testing, so that's causing some git conflict -- I'm looking into it |
Alternative approach for #154
Usage in tests
We enhanced
log_shiny_input_changes
so that it usessession
object.This allows to detect if we are in the Mocked Shiny session - a type of the session used in
shiny::testServer
during{testthat}
tests. This is needed so that tests usingshiny::testServer
do not fail due to:Distinction between modules
The ability of using
session
object allows to extract the current module's namespace. This is useful for logging, if you have multiple modules with the same input names. This way you can distinguish log-messages based on modules' namespaces.Shiny App Code
Output