Skip to content

Commit

Permalink
add teardown again
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Jan 30, 2025
1 parent 647af22 commit af8ff8c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (rlang::is_installed("curl")) {
internet <- FALSE
message("Internet: ", internet)
}

saveLoc <- tempfile("saveLoc")
dir.create(saveLoc)

Expand Down Expand Up @@ -180,3 +180,20 @@ if (internet && rlang::is_installed("Eunomia")) {
saveDirectory = file.path(saveLoc, "tinyResults")
)
}

withr::defer(
{
if (Sys.getenv("GITHUB_ACTIONS") == "true") {
# Remove the JDBC driver folder
jarFolder <- Sys.getenv("DATABASECONNECTOR_JAR_FOLDER", unset = "")
if (jarFolder != "") {
unlink(jarFolder, recursive = TRUE)
}
}
unlink(saveLoc, recursive = TRUE)
if (internet && rlang::is_installed("Eunomia")) {
unlink(connectionDetails$server())
}
},
envir = teardown_env()
)

0 comments on commit af8ff8c

Please sign in to comment.