if (identical(Sys.getenv("CIRCLECI"), "true"))
{
test.files <- list.files("tests/testthat", pattern = "\\.R$")
test.files <- gsub("test-|\\.R$", "", test.files)
test.filter <- grep("^[asrcd]", test.files,
invert = TRUE, value = TRUE)
test.filter <- paste0("^", test.filter, "$")
if (!dir.exists("reports"))
dir.create("reports")
out.file <- paste0("reports/test_results", Sys.getenv("CIRCLE_NODE_INDEX"), ".xml")
exit.code <- flipDevTools::RunTestsOnCircleCI(filter = paste0(test.filter, collapse = "|"),
load_package = "none", output_file = out.file)
q(status = exit.code, save = "no")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.