Added two new projects into "tests/testthat" for checking has_no_randomness(). These are:
• "project_random": has an Rmd that uses randomness but sets no seed
• "project_randomseed": has an Rmd that uses randomness but sets a seed
Created a new shim for set.seed()
has_no_randomness() has gone through several changes:
• No longer have to input seed_old as a parameter. Just give a directory.
• Now uses the render log to record seed information before and after rendering, which notes whether randomness has been used. The saved "seed" that's recorded into the render log is the second entry in .Random.seed, which dictates the rest of the pattern of random numbers.
• Uses the set.seed shim to check if a seed has been used, in addition to whether randomness was found.
Wrote new has_no_randomness checks for three projects:
• project_noob passes (no randomness used at all)
• project_random fails
• project_randomseed passes
All checks in test-check.R now pass when run line by line (but not yet in R CMD CHECK).
proj_render() has also been changed:
• No longer renders in an alternate R session, but still renders in a tempdir(). This has fixed many problems, including the fact that project_miceps was failing to log anything when we ran proj_render(). Now, all functions seem to be getting logged and we don't seem to be having the same issues with the location of fertile in the search() path anymore. Every shimmed function appears to be showing up in the logs for all of the test projects now! Additionally, this is how has_no_randomness() was actually able to work. Previously, the simple act of running proj_render() would change the seed irrelevant of whether or not there was randomness in the code. This is no longer the case.
Finally, several shims now check whether or not we are in render mode before running check_path so that uses of those shimmed functions will ALWAYS be recorded in the log, and files will render properly. Shimmed functions will only throw a path error if we are in interactive mode.
Note: for the ease of future troubleshooting, I have also commented out Amelia's tests that run during R CMD CHECK because they were making it difficult to find the actual errors we wanted. I'll add those back in later if wanted.
Added two new projects into "tests/testthat" for checking
has_no_randomness()
. These are: • "project_random": has an Rmd that uses randomness but sets no seed • "project_randomseed": has an Rmd that uses randomness but sets a seedCreated a new shim for
set.seed()
has_no_randomness()
has gone through several changes: • No longer have to inputseed_old
as a parameter. Just give a directory. • Now uses the render log to record seed information before and after rendering, which notes whether randomness has been used. The saved "seed" that's recorded into the render log is the second entry in.Random.seed
, which dictates the rest of the pattern of random numbers. • Uses the set.seed shim to check if a seed has been used, in addition to whether randomness was found.Wrote new
has_no_randomness
checks for three projects: • project_noob passes (no randomness used at all) • project_random fails • project_randomseed passesAll checks in
test-check.R
now pass when run line by line (but not yet in R CMD CHECK).proj_render()
has also been changed: • No longer renders in an alternate R session, but still renders in atempdir()
. This has fixed many problems, including the fact that project_miceps was failing to log anything when we ranproj_render()
. Now, all functions seem to be getting logged and we don't seem to be having the same issues with the location of fertile in thesearch()
path anymore. Every shimmed function appears to be showing up in the logs for all of the test projects now! Additionally, this is howhas_no_randomness()
was actually able to work. Previously, the simple act of runningproj_render()
would change the seed irrelevant of whether or not there was randomness in the code. This is no longer the case.Finally, several shims now check whether or not we are in render mode before running
check_path
so that uses of those shimmed functions will ALWAYS be recorded in the log, and files will render properly. Shimmed functions will only throw a path error if we are in interactive mode.Note: for the ease of future troubleshooting, I have also commented out Amelia's tests that run during R CMD CHECK because they were making it difficult to find the actual errors we wanted. I'll add those back in later if wanted.