skip_if_no_db <- function() {
my_envs <- Sys.getenv(c("SCIDB_TEST_HOST", "SCIDB_TEST_PORT", "SCIDB_USER", "SCIDB_PASSWORD"))
if(is.null(my_envs["SCIDB_TEST_HOST"]) |
is.null(my_envs["SCIDB_TEST_PORT"]) |
is.null(my_envs["SCIDB_USER"]) |
is.null(my_envs["SCIDB_PASSWORD"])) {
skip("DB Tests require all environment variables: SCIDB_TEST_HOST, SCIDB_TEST_PORT, SCIDB_USER, SCIDB_PASSWORD")
} else if (identical(Sys.getenv("SCIDB_TEST_HOST"), "") |
identical(Sys.getenv("SCIDB_TEST_PORT"), "") |
identical(Sys.getenv("SCIDB_USER"), "") |
identical(Sys.getenv("SCIDB_PASSWORD"), "")) {
skip("Skipping due to no DB connection information in environment variables")
} else {
return(invisible(TRUE))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.