Will clone repo at version tag and run test suite. Package will be built and installed (along with any missing dependencies) to a temporary library. Then we run all tests for repo, roll up successes and failures, and write to a CSV file. Also writes the commit hash of the package and some other system info to a JSON file.

validate_tests(
  org,
  repo,
  version,
  domain = VALID_DOMAINS,
  out_file = NULL,
  root_dir = tempdir(),
  output_dir = getwd(),
  extra_test_dirs = NULL,
  set_id_to_name = FALSE
)

Arguments

org

Github organization that the repo is under

repo

The name of the repo for the package you are validating

version

The version number of the package you are validating. This must correspond to a tag in the repo.

domain

Domain where repo lives. Either "github.com" or "ghe.metrumrg.com", defaulting to "github.com"

out_file

File path to write out the test results to. Any extension will be ignored and replaced with .csv for the test output df and .json for the get_sys_info() output.

root_dir

The directory path to where the package has been cloned. file.path(root_dir, repo) should lead to the cloned repo that will be tested.

output_dir

Directory to write the test outputs to. Defaults to working directory.

extra_test_dirs

Character vector of paths (relative to package root dir) to directories that contain additional tests to run

set_id_to_name

Whether to copy the TestName column over to the TestId column when writing the output CSV. This exists to support legacy issues and tests that don't use IDs. Starting with v1.0, mrgvalidate relies on test IDs and, as a temporary compatibility kludge, will auto-generate them if the TestId and TestName columns match. New tests and issues should use test IDs.

Value

Invisibly returns tibble of formatted test output. Note that this function is primarily called for the side effect of writing out the output to disk.

Details

The package found at file.path(root_dir, repo) will be built and installed into a tempory library that is appended to the beginning of your .libPaths(), using devtools::install(..., build = TRUE, upgrade = "never"). This will also install (into the temporary library) any dependencies from the package that are not found in your .libPaths().