diff --git a/DESCRIPTION b/DESCRIPTION index 6b81c97..28be57a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,8 @@ Imports: Suggests: knitr, testthat (>= 3.0.0), - RSQLite + RSQLite, + withr NeedsCompilation: no RoxygenNote: 7.1.1 Config/testthat/edition: 3 diff --git a/tests/setup.R b/tests/setup.R new file mode 100644 index 0000000..5cc6b42 --- /dev/null +++ b/tests/setup.R @@ -0,0 +1,12 @@ +# Download the JDBC drivers used in the tests + +oldJarFolder <- Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") +Sys.setenv("DATABASECONNECTOR_JAR_FOLDER" = tempfile("jdbcDrivers")) +downloadJdbcDrivers("postgresql") +# downloadJdbcDrivers("sql server") +# downloadJdbcDrivers("oracle") + +withr::defer({ + unlink(Sys.getenv("DATABASECONNECTOR_JAR_FOLDER"), recursive = TRUE, force = TRUE) + Sys.setenv("DATABASECONNECTOR_JAR_FOLDER" = oldJarFolder) +}, testthat::teardown_env())