From 297021114ced694767ef4116b197942bbc161b3b Mon Sep 17 00:00:00 2001 From: schuemie Date: Tue, 18 Jun 2024 14:15:16 +0200 Subject: [PATCH] Removing DuckDB from unit tests --- tests/testthat/setup.R | 92 +++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index d11efa41..a7dfc12e 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -220,49 +220,49 @@ testServers[[length(testServers) + 1]] <- list( ) # DuckDB -duckdbFile <- tempfile(fileext = ".duckdb") -if (testthat::is_testing()) { - withr::defer(unlink(duckdbFile, force = TRUE), testthat::teardown_env()) -} -cdmDatabaseSchema <- "main" -connectionDetails <- createConnectionDetails( - dbms = "duckdb", - server = duckdbFile -) -connection <- connect(connectionDetails) -insertTable( - connection = connection, - databaseSchema = cdmDatabaseSchema, - tableName = "person", - data = data.frame(person_id = seq_len(100), - year_of_birth = round(runif(100, 1900, 2000)), - race_concept_id = as.numeric(NA), - gender_concept_id = rep(c(8507, 8532), 50), - care_site_id = round(runif(100, 1, 1e7))) -) -insertTable( - connection = connection, - databaseSchema = cdmDatabaseSchema, - tableName = "observation_period", - data = data.frame(person_id = seq_len(100), - observation_period_start_date = rep(as.Date("2000-01-01"), 100), - observation_period_end_date = rep(as.Date(c("2000-06-01", "2001-12-31")), 50), - period_type_concept_id = rep(0, 100)) -) -insertTable( - connection = connection, - databaseSchema = cdmDatabaseSchema, - tableName = "vocabulary", - data = data.frame(vocabulary_id = c("a", "b"), - vocabulary_name = c("a", "b"), - vocabulary_reference= c("a", "b"), - vocabulary_version = c("a", "b"), - vocabulary_concpet_id = c(1, 2)) -) -disconnect(connection) -testServers[[length(testServers) + 1]] <- list( - connectionDetails = connectionDetails, - NULL, - cdmDatabaseSchema = cdmDatabaseSchema, - tempEmulationSchema = NULL -) +# duckdbFile <- tempfile(fileext = ".duckdb") +# if (testthat::is_testing()) { +# withr::defer(unlink(duckdbFile, force = TRUE), testthat::teardown_env()) +# } +# cdmDatabaseSchema <- "main" +# connectionDetails <- createConnectionDetails( +# dbms = "duckdb", +# server = duckdbFile +# ) +# connection <- connect(connectionDetails) +# insertTable( +# connection = connection, +# databaseSchema = cdmDatabaseSchema, +# tableName = "person", +# data = data.frame(person_id = seq_len(100), +# year_of_birth = round(runif(100, 1900, 2000)), +# race_concept_id = as.numeric(NA), +# gender_concept_id = rep(c(8507, 8532), 50), +# care_site_id = round(runif(100, 1, 1e7))) +# ) +# insertTable( +# connection = connection, +# databaseSchema = cdmDatabaseSchema, +# tableName = "observation_period", +# data = data.frame(person_id = seq_len(100), +# observation_period_start_date = rep(as.Date("2000-01-01"), 100), +# observation_period_end_date = rep(as.Date(c("2000-06-01", "2001-12-31")), 50), +# period_type_concept_id = rep(0, 100)) +# ) +# insertTable( +# connection = connection, +# databaseSchema = cdmDatabaseSchema, +# tableName = "vocabulary", +# data = data.frame(vocabulary_id = c("a", "b"), +# vocabulary_name = c("a", "b"), +# vocabulary_reference= c("a", "b"), +# vocabulary_version = c("a", "b"), +# vocabulary_concpet_id = c(1, 2)) +# ) +# disconnect(connection) +# testServers[[length(testServers) + 1]] <- list( +# connectionDetails = connectionDetails, +# NULL, +# cdmDatabaseSchema = cdmDatabaseSchema, +# tempEmulationSchema = NULL +# )