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

add shinytest2 for testing run example and draft yaml for deploy #118

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

cjrace
Copy link
Collaborator

@cjrace cjrace commented Dec 11, 2024

Overview of changes

Prepared run_example() so we can deploy it on our shinyapps.io account.

Updated the run_example test to use shinytest2, which opens up the potential for more UI testing of components.

Fixed a bug in run_example() (found by the shinytest2 tests spitting out a warning) where we had two IDs with the same name:

image

While I was there I used styler on the R/run_example.R file, I think that accounts for most of the changes - just code formatting rather than substantive.

PR Checklist

  • I have updated the documentation (if needed)
  • I have added or updated tests for these changes (if applicable)
  • I have tested these changes locally using devtools::check()

Reviewer instructions

Mostly just check the changes in run_example() app. If that's fine then I think this is good to in.

Once I've got the deployment working I'll update the docs to point to it, waiting until it's working to do that though.

I've prepared a draft yaml file for the deployment GitHub action, expecting I may need to do some trial and error on the master branch once this is merged to get it working, I've never deployed an app returned by a function in this way before (alternative could be to make an app folder within the inst/ directory and then make run_example() call shiny::runApp("inst/showcase_app") (or something to that effect. I'll try to make this way work first, and then if I need to make bigger changes to move code around I'll do it in a new PR.

@cjrace cjrace self-assigned this Dec 11, 2024
@cjrace cjrace added the enhancement New feature or request label Dec 11, 2024
@cjrace cjrace requested a review from sarahmwong December 11, 2024 15:08
@cjrace cjrace marked this pull request as ready for review December 11, 2024 15:09
Copy link
Collaborator

@sarahmwong sarahmwong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Cam! Teeny bugs spotted here - think these have just slipped through when we've been adding things over time - shiny tests will be a really neat way to avoid this in future 😄

R/run_example.R Show resolved Hide resolved
R/run_example.R Show resolved Hide resolved
R/run_example.R Outdated Show resolved Hide resolved
R/run_example.R Show resolved Hide resolved
@cjrace cjrace merged commit f9520f8 into master Dec 11, 2024
6 checks passed
@cjrace cjrace deleted the deploy-showcase-app branch December 11, 2024 17:28
@cjrace cjrace mentioned this pull request Dec 11, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants