Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

automatically rerun after code change #4

Open
katrinleinweber opened this issue Jun 24, 2017 · 4 comments
Open

automatically rerun after code change #4

katrinleinweber opened this issue Jun 24, 2017 · 4 comments

Comments

@katrinleinweber
Copy link

Spun out of r-lib/testthat/pull/598, this issue starts the discussion on automation options for shine(). I naively guess (testthat & shiny beginner) that copying testthat::auto_test_package() plus lower-level functions would be necessary, plus making them reload brushthat's app.

@krlmlr
Copy link
Owner

krlmlr commented Nov 12, 2017

Maybe it's enough to just start running the test when detecting a file change?

We could also keep running auto_test_package() in a separate process and just display the results in the Shiny app. For this we could use a custom reporter that serializes the results to a file in a pre-agreed temporary file; the Shiny app then just watches for changes to this file (or read the worker process's stdout).

See also #5 for my own wish list ;-)

@katrinleinweber
Copy link
Author

[…] just start running the test when detecting a file change?

Sure, that would be enough IMHO.

@krlmlr
Copy link
Owner

krlmlr commented Nov 12, 2017

Thanks. I just wasn't sure if we really need to reload the app.

Happy to review a PR that runs the code that generates the results in a separate process, maybe using callr::r_bg() and polling that process's stdout. I prefer keeping the current logic of re-running only the failed tests (because it's easy to rerun all tests by just restarting the app). I see two ways to achieve this:

  1. Copy a part of the logic of auto_test() here.
  2. Enhance auto_test() to re-run only failing tests, as suggested in ?auto_test.

@katrinleinweber
Copy link
Author

I'm afraid both are out of my league, sorry. Also: will focus on carpentries & exercism.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants