Description Usage Arguments Details Value Examples
For interactive testing of orderly code. This runs through and sets everything up as orderly would (creates a new working directory and copies files into it, pulls data from the database, copies over any dependent reports) but then rather than running the report hands back to the user.
1 2 3 4 5 6 7 8 9 10 11 12 | orderly_test_start(
name,
parameters = NULL,
envir = parent.frame(),
root = NULL,
locate = TRUE,
instance = NULL,
use_draft = FALSE,
remote = NULL
)
orderly_test_check(path = NULL)
|
name |
Name of the report to run (see
|
parameters |
Parameters passed to the report. A named list of
parameters declared in the |
envir |
The parent of the environment that will be used to evaluate the report script; by default a new environment will be made with the global environment as the parent. |
root |
The path to an orderly root directory, or |
locate |
Logical, indicating if the configuration should be
searched for. If |
instance |
Select instance of the source database to be used,
where multiple instances are configured. Use a single
unnamed character string to indicate an instance to
match. If given, then this name must be present in all
databases where instances are listed in
|
use_draft |
Should draft reports be used for dependencies?
This should be used only in development. Valid values are
logical ( |
remote |
Remote to use to resolve dependencies. Use this in
order to run a report with the same dependencies as are
available on a remote server, particularly when using |
path |
Path to the report that is currently being run |
Previous versions of orderly changed into the created directory
when using orderly::orderly_test_start
, which allowed
interactive testing of a report, including ensuring that it has
created all expected outputs. However, CRAN rules do not allow
changing the working directory, which significantly reduces the
usefulness of this function - as such we may remove it entirely in
a future version of orderly if it does not prove useful in this
more limited form.
The new suggested workflow is:
run orderly_test_start(...)
to prepare a report directory
manually change into that directory following the printed instructions
use orderly_test_check
to check that your report has created
the expected artefacts
manually change back to your original directory
The path to the report directory
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | path <- orderly::orderly_example("minimal")
p <- orderly::orderly_test_start("example", root = path)
# The data in the orderly example is now available to use
dat
# Check to see which artefacts have been created so far:
orderly::orderly_test_check(p)
# Manually the code that this report has in its script
png(file.path(p, "mygraph.png"))
barplot(setNames(dat$number, dat$name), las = 2)
dev.off()
# We now confirm that the artefact has been created:
orderly::orderly_test_check(p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.