-
Notifications
You must be signed in to change notification settings - Fork 23
WIP feat: Allow for packages to be dynamically loaded in app #402
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
Draft
schloerke
wants to merge
23
commits into
main
Choose a base branch
from
pkg_test_env
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2dae122
Commit code before gutting
schloerke 7c70eb6
commit code before computer breaks
schloerke 918664e
Merge branch 'main' into pkg_test_env
schloerke 5167a2d
Merge branch 'main' into pkg_test_env
schloerke bf57461
Add pkgload as new dep
schloerke 1fcf20a
Update test files
schloerke e89fdd2
Commit changes before chopping code
schloerke bbca165
Merge branch 'pkg_test_env' of https://github.com/rstudio/shinytest2 …
schloerke 0d6bf0a
Do not enable the local package's namespace when testing
schloerke 767f7ef
Remove old setup code
schloerke eb95f71
Be explicit on return value
schloerke 67d8fd8
Update comment for `load_package`
schloerke b50d8d0
Clean up loading code to only load exported source fns
schloerke 13e5a58
Move variant folders for more robust testing
schloerke 6c7fa51
Update to latest snaps
schloerke 1a5fee0
Update local variable name used for testing
schloerke db958d3
Do not attach local package. Only add it to the search path for local…
schloerke a1a8045
Update snaps
schloerke 58c7b59
lint
schloerke 4feb531
Fix sanity check for testing (now that we're trying to compile the pa…
schloerke eea9330
Add vanilla golem app to test
schloerke 1c8879d
temp. please vet files
schloerke 6d60117
Merge branch 'main' into pkg_test_env
schloerke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
library(shiny) | ||
|
||
# Test for internal value | ||
# This is defined within shinytest2's ./R/app-driver-start.R | ||
# and will only allow the app to run if the app has access to shinytest2's internal functions | ||
# or the "local package" values. | ||
value <- internal_shinytest2_value | ||
|
||
ui <- fluidPage( | ||
tags$h1("Internal test value:"), | ||
verbatimTextOutput("value", placeholder = TRUE), | ||
) | ||
server <- function(input, output, session) { | ||
output$value <- renderText({ | ||
value | ||
}) | ||
} | ||
|
||
shinyApp(ui, server) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
shinytest2::test_app() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
shinytest2::load_app_env() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
test_that("local pkg env is loaded", { | ||
expect_equal(internal_shinytest2_value, TRUE) | ||
|
||
AppDriver$new(variant = NULL) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.