Skip to content

Commit

Permalink
Many more skips
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Mar 27, 2024
1 parent f159b42 commit f329000
Show file tree
Hide file tree
Showing 11 changed files with 179 additions and 0 deletions.
131 changes: 131 additions & 0 deletions tests/testthat/test-DBItest.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/test-connect.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-dbwritetable.R
Original file line number Diff line number Diff line change
@@ -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))

Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-factor.R
Original file line number Diff line number Diff line change
@@ -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))

Expand All @@ -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))

Expand All @@ -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))

Expand Down Expand Up @@ -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))

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-register.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-register_arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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))

Expand All @@ -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))

Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-struct.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-tbl__duckdb_connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-timestamp.R
Original file line number Diff line number Diff line change
@@ -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))

Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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
Expand Down

0 comments on commit f329000

Please sign in to comment.