From f769d0bc4dee00c7532d90739ef5e2e129e8faf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Wed, 27 Mar 2024 13:08:48 +0100 Subject: [PATCH] Many more skips --- tests/testthat/test-DBItest.R | 131 +++++++++++++++++++ tests/testthat/test-arrow.R | 2 + tests/testthat/test-connect.R | 12 ++ tests/testthat/test-dbwritetable.R | 2 + tests/testthat/test-factor.R | 8 ++ tests/testthat/test-readonly.R | 2 + tests/testthat/test-register.R | 2 + tests/testthat/test-register_arrow.R | 6 + tests/testthat/test-shutdown.R | 2 + tests/testthat/test-struct.R | 4 + tests/testthat/test-tbl__duckdb_connection.R | 6 + tests/testthat/test-timestamp.R | 2 + tests/testthat/test-viewer.R | 4 + 13 files changed, 183 insertions(+) diff --git a/tests/testthat/test-DBItest.R b/tests/testthat/test-DBItest.R index 521bbfa9f..e20ae1316 100644 --- a/tests/testthat/test-DBItest.R +++ b/tests/testthat/test-DBItest.R @@ -2,6 +2,137 @@ skip_on_cran() if (rlang::is_installed("DBItest")) DBItest::test_all(c( if (!TEST_RE2) c( + "send_query_immediate", + "clear_result_return_query_arrow", + "cannot_clear_result_twice_query_arrow", + "get_query_immediate", + "send_statement_params", + "execute_params", + "read_table_missing", + "read_table_row_names_false", + "read_table_row_names_true_exists", + "read_table_row_names_true_missing", + "read_table_row_names_na_exists", + "read_table_row_names_string_exists", + "read_table_row_names_string_missing", + "read_table_row_names_default", + "read_table_check_names", + "read_table_check_names_false", + "read_table_closed_connection", + "read_table_invalid_connection", + "read_table_error", + "read_table_name", + "create_table_error", + "create_table_temporary", + "create_table_row_names_non_null", + "append_table_missing", + "append_table_error", + "append_roundtrip_quotes", + "append_roundtrip_time", + "append_roundtrip_mixed", + "write_table_return", + "write_table_overwrite", + "write_table_append_incompatible", + "roundtrip_.*", + "write_table_name", + "write_table_value_df", + "temporary_table", + "roundtrip_keywords", + "roundtrip_quotes", + "roundtrip_quotes_table_names", + "roundtrip_integer", + "roundtrip_numeric", + "roundtrip_logical", + "roundtrip_null", + "roundtrip_64_bit_numeric", + "roundtrip_64_bit_roundtrip", + "write_table_row_names_false", + "write_table_row_names_true_exists", + "write_table_row_names_na_exists", + "write_table_row_names_string_exists", + "write_table_row_names_default", + "list_tables_temporary", + "exists_table", + "exists_table_temporary", + "exists_table_error", + "exists_table_name", + "remove_table_return", + "remove_table_missing", + "remove_table_closed_connection", + "remove_table_invalid_connection", + "remove_table_error", + "remove_table_temporary_arg", + "remove_table_missing_succeed", + "remove_table_temporary", + "remove_table_name", + "list_objects_temporary", + "list_fields", + "list_fields_temporary", + "list_fields_wrong_table", + "list_fields_quoted", + "list_fields_row_names", + "bind_return_value_statement", + "bind_multi_row_unequal_length", + "bind_multi_row_statement", + "bind_repeated_statement", + "bind_repeated_untouched_statement", + "arrow_bind_multi_row_unequal_length", + "stream_bind_return_value_statement", + "stream_bind_multi_row_statement", + "stream_bind_repeated_statement", + "stream_bind_repeated_untouched_statement", + "column_info", + "column_info_row_names", + "rows_affected_statement", + "begin_write_commit", + "begin_write_rollback", + "begin_write_disconnect", + "with_transaction_success", + "with_transaction_failure", + "with_transaction_break", + "arrow_send_query_immediate", + "arrow_get_query_arrow_immediate", + "arrow_read_table_arrow", + "arrow_read_table_arrow_missing", + "arrow_read_table_arrow_empty", + "arrow_read_table_arrow_closed_connection", + "arrow_read_table_arrow_invalid_connection", + "arrow_read_table_arrow_error", + "arrow_read_table_arrow_name", + "arrow_write_table_arrow_return", + "arrow_write_table_arrow_error_overwrite", + "arrow_write_table_arrow_append_incompatible", + "arrow_write_table_arrow_error", + "arrow_write_table_arrow_name", + "arrow_write_table_arrow_value_df", + "arrow_write_table_arrow_overwrite", + "arrow_write_table_arrow_overwrite_missing", + "arrow_write_table_arrow_append", + "arrow_write_table_arrow_append_new", + "arrow_write_table_arrow_temporary", + "arrow_write_table_arrow_visible_in_other_connection", + "arrow_write_table_arrow_roundtrip_quotes", + "arrow_write_table_arrow_roundtrip_quotes_table_names", + "arrow_write_table_arrow_roundtrip_integer", + "arrow_write_table_arrow_roundtrip_numeric", + "arrow_write_table_arrow_roundtrip_null", + "arrow_write_table_arrow_roundtrip_64_bit_roundtrip", + "arrow_write_table_arrow_roundtrip_character_empty", + "arrow_write_table_arrow_roundtrip_character_empty_after", + "arrow_write_table_arrow_roundtrip_date", + "arrow_write_table_arrow_roundtrip_date_extended", + "arrow_write_table_arrow_roundtrip_time", + "arrow_write_table_arrow_roundtrip_mixed", + "arrow_create_table_arrow_error", + "arrow_create_table_arrow_temporary", + "arrow_create_table_arrow_visible_in_other_connection", + "arrow_append_table_arrow_return", + "arrow_append_table_arrow_missing", + "arrow_append_table_arrow_error", + "arrow_append_table_arrow_roundtrip_quotes", + "arrow_append_table_arrow_roundtrip_64_bit_roundtrip", + "arrow_append_table_arrow_roundtrip_time", + "arrow_append_table_arrow_roundtrip_mixed", "list_tables", "list_tables_quote", "list_fields_object", diff --git a/tests/testthat/test-arrow.R b/tests/testthat/test-arrow.R index 356536919..28e2729b6 100644 --- a/tests/testthat/test-arrow.R +++ b/tests/testthat/test-arrow.R @@ -262,6 +262,8 @@ test_that("to_duckdb with a table", { }) test_that("to_duckdb passing a connection", { + skip_if_not(TEST_RE2) + ds <- InMemoryDataset$create(example_data) con_separate <- dbConnect(duckdb()) diff --git a/tests/testthat/test-connect.R b/tests/testthat/test-connect.R index ba5b211c4..80310063b 100644 --- a/tests/testthat/test-connect.R +++ b/tests/testthat/test-connect.R @@ -56,6 +56,8 @@ test_that("no warning on dbConnect() with other dbdir", { }) test_that("can connect to the same in-memory database via the same driver object", { + skip_if_not(TEST_RE2) + drv <- duckdb() con1 <- dbConnect(drv) @@ -74,6 +76,8 @@ test_that("can connect to the same in-memory database via the same driver object }) test_that("will connect to different in-memory databases via different driver objects", { + skip_if_not(TEST_RE2) + drv1 <- duckdb() con1 <- dbConnect(drv1) on.exit(dbDisconnect(con1), add = TRUE) @@ -92,6 +96,8 @@ test_that("will connect to different in-memory databases via different driver ob }) test_that("can connect to the same database file via the same driver object", { + skip_if_not(TEST_RE2) + drv <- duckdb(tempfile(fileext = ".duckdb")) con1 <- dbConnect(drv) @@ -110,6 +116,8 @@ test_that("can connect to the same database file via the same driver object", { }) test_that("can connect to the same database file via different driver objects", { + skip_if_not(TEST_RE2) + path <- tempfile(fileext = ".duckdb") writeLines(character(), path) path <- normalizePath(path) @@ -133,6 +141,8 @@ test_that("can connect to the same database file via different driver objects", }) test_that("read_only only applies to the first driver object for a path", { + skip_if_not(TEST_RE2) + path <- tempfile(fileext = ".duckdb") writeLines(character(), path) path <- normalizePath(path) @@ -154,6 +164,8 @@ test_that("read_only only applies to the first driver object for a path", { }) test_that("config only applies to the first driver object for a path", { + skip_if_not(TEST_RE2) + path <- tempfile(fileext = ".duckdb") writeLines(character(), path) path <- normalizePath(path) diff --git a/tests/testthat/test-dbwritetable.R b/tests/testthat/test-dbwritetable.R index ad49aecf0..45b613f96 100644 --- a/tests/testthat/test-dbwritetable.R +++ b/tests/testthat/test-dbwritetable.R @@ -1,4 +1,6 @@ test_that("dbWriteTable can write tables with keyword column names", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) diff --git a/tests/testthat/test-factor.R b/tests/testthat/test-factor.R index f352c588c..ba2f5dd53 100644 --- a/tests/testthat/test-factor.R +++ b/tests/testthat/test-factor.R @@ -1,4 +1,6 @@ test_that("factors can be round tripped", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) @@ -20,6 +22,8 @@ test_that("factors can be round tripped", { test_that("iris can be round-tripped", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) @@ -33,6 +37,8 @@ test_that("iris can be round-tripped", { }) test_that("non-utf things can be read", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) @@ -60,6 +66,8 @@ test_that("non-utf things can be read", { test_that("single value factors round trip correctly, issue 2627", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) diff --git a/tests/testthat/test-readonly.R b/tests/testthat/test-readonly.R index accd62240..e69859c4d 100644 --- a/tests/testthat/test-readonly.R +++ b/tests/testthat/test-readonly.R @@ -1,4 +1,6 @@ test_that("read_only flag and shutdown works as expected", { + skip_if_not(TEST_RE2) + dbdir <- tempfile() # 1st: create a db and write some tables diff --git a/tests/testthat/test-register.R b/tests/testthat/test-register.R index 8359580f2..b02ecc359 100644 --- a/tests/testthat/test-register.R +++ b/tests/testthat/test-register.R @@ -38,6 +38,8 @@ test_that("duckdb_register() works", { test_that("various error cases for duckdb_register()", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) duckdb_register(con, "my_df1", iris) diff --git a/tests/testthat/test-register_arrow.R b/tests/testthat/test-register_arrow.R index f9c29ee2c..11fd5196d 100644 --- a/tests/testthat/test-register_arrow.R +++ b/tests/testthat/test-register_arrow.R @@ -7,6 +7,8 @@ skip_if_not(arrow::arrow_with_parquet(), message = "The installed Arrow is not f library("arrow") test_that("duckdb_register_arrow() works", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) @@ -27,6 +29,8 @@ test_that("duckdb_register_arrow() works", { }) test_that("duckdb_register_arrow() works with record_batch_readers", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) @@ -45,6 +49,8 @@ test_that("duckdb_register_arrow() works with record_batch_readers", { }) test_that("duckdb_register_arrow() works with scanner", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) diff --git a/tests/testthat/test-shutdown.R b/tests/testthat/test-shutdown.R index 8b14776ae..4c7822998 100644 --- a/tests/testthat/test-shutdown.R +++ b/tests/testthat/test-shutdown.R @@ -1,4 +1,6 @@ test_that("disconnect releases database file", { + skip_if_not(TEST_RE2) + db_path <- withr::local_tempfile(fileext = ".duckdb") session_1 <- callr::r_session$new() diff --git a/tests/testthat/test-struct.R b/tests/testthat/test-struct.R index 0235e499e..e63f5461c 100644 --- a/tests/testthat/test-struct.R +++ b/tests/testthat/test-struct.R @@ -110,6 +110,8 @@ test_that("structs give the same results via Arrow", { }) test_that("nested lists of atomic values can be written", { + skip_if_not(TEST_RE2) + skip_if_not_installed("vctrs") con <- dbConnect(duckdb()) @@ -128,6 +130,8 @@ test_that("nested lists of atomic values can be written", { }) test_that("nested and packed columns work in full", { + skip_if_not(TEST_RE2) + skip_if_not_installed("vctrs") con <- dbConnect(duckdb()) diff --git a/tests/testthat/test-tbl__duckdb_connection.R b/tests/testthat/test-tbl__duckdb_connection.R index d10d5d399..522d172ab 100644 --- a/tests/testthat/test-tbl__duckdb_connection.R +++ b/tests/testthat/test-tbl__duckdb_connection.R @@ -4,6 +4,8 @@ if (rlang::is_installed("dbplyr")) { } test_that("Parquet files can be registered with dplyr::tbl()", { + skip_if_not(TEST_RE2) + skip_if_not_installed("dbplyr") con <- DBI::dbConnect(duckdb()) @@ -86,6 +88,8 @@ test_that("Object cache can be enabled for parquet files with tbl_file() and tbl test_that("CSV files can be registered with dplyr::tbl()", { + skip_if_not(TEST_RE2) + skip_if_not_installed("dbplyr") path <- file.path(tempdir(), "duckdbtest.csv") @@ -125,6 +129,8 @@ test_that("CSV files can be registered with tbl_file() and tbl_query()", { test_that("Other replacement scans or functions can be registered with dplyr::tbl()", { + skip_if_not(TEST_RE2) + skip_if_not_installed("dbplyr") con <- DBI::dbConnect(duckdb()) diff --git a/tests/testthat/test-timestamp.R b/tests/testthat/test-timestamp.R index 7a9e0a0a5..ed14cdb77 100644 --- a/tests/testthat/test-timestamp.R +++ b/tests/testthat/test-timestamp.R @@ -1,4 +1,6 @@ test_that("fractional seconds can be roundtripped", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) diff --git a/tests/testthat/test-viewer.R b/tests/testthat/test-viewer.R index fb7ea7e8a..b598b0131 100644 --- a/tests/testthat/test-viewer.R +++ b/tests/testthat/test-viewer.R @@ -57,6 +57,8 @@ test_that("rs_list_columns", { }) test_that("rs_viewer", { + skip_if_not(TEST_RE2) + con <- dbConnect(duckdb()) on.exit(dbDisconnect(con, shutdown = TRUE)) @@ -75,6 +77,8 @@ test_that("rs_actions", { }) test_that("mock observer hooray", { + skip_if_not(TEST_RE2) + called_connection_opened <- FALSE called_connection_closed <- FALSE called_connection_updated <- FALSE