Skip to content

Commit

Permalink
run rds create db test only if running with specific env var - #74
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Oct 4, 2024
1 parent 07481ea commit 0967377
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ vign_db:
cd ..

test:
${RSCRIPT} -e "devtools::test()"
SIXTYFOUR_RUN_LOCAL_ONLY_TESTS=true ${RSCRIPT} -e "devtools::test()"

readme:
${RSCRIPT} -e "knitr::knit('README.Rmd')"
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/helper-funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ random_string <- function(prefix, size = 8) {
"{prefix}{paste0(sample(letters, size = size), collapse = '')}"
)
}

running_local_only_tests <- function() {
as.logical(Sys.getenv("SIXTYFOUR_RUN_LOCAL_ONLY_TESTS", FALSE))
}
1 change: 1 addition & 0 deletions tests/testthat/test-db-rds.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
test_that("aws_db_rds_create", {
skip_on_ci()
skip_if_not(running_local_only_tests())
vcr::use_cassette("aws_db_rds_create", {
z <- aws_db_rds_create(
id = "bananas2", class = "db.t3.micro",
Expand Down

0 comments on commit 0967377

Please sign in to comment.