Skip to content

Commit

Permalink
chore: Replace unconditional skip with versioned skip
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 26, 2023
1 parent d0fe741 commit 4a7dd72
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 52 deletions.
34 changes: 17 additions & 17 deletions R/spec-arrow-append-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ spec_arrow_append_table_arrow <- list(
expect_equal(names(formals(dbAppendTableArrow)), c("conn", "name", "value", "..."))
},

arrow_append_table_arrow_return = function(con, table_name) {
skip("Failed in SQLite")
arrow_append_table_arrow_return = function(ctx, con, table_name) {
skip_if_not_dbitest(ctx, "1.8.0.50")

#' @return
#' `dbAppendTableArrow()` returns a
Expand Down Expand Up @@ -74,8 +74,8 @@ spec_arrow_append_table_arrow <- list(
},

#'
arrow_append_table_arrow_roundtrip_keywords = function(con) {
skip("Requires dbBind() on RMariaDB")
arrow_append_table_arrow_roundtrip_keywords = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.49")

#' @section Specification:
#' SQL keywords can be used freely in table names, column names, and data.
Expand All @@ -87,7 +87,7 @@ spec_arrow_append_table_arrow <- list(
},

arrow_append_table_arrow_roundtrip_quotes = function(ctx, con, table_name) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.48")

#' Quotes, commas, spaces, and other special characters such as newlines and tabs,
#' can also be used in the data,
Expand Down Expand Up @@ -197,7 +197,7 @@ spec_arrow_append_table_arrow <- list(
},
#
arrow_append_table_arrow_roundtrip_64_bit_character = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.47")

tbl_in <- data.frame(a = c(-1e14, 1e15))
tbl_exp <- tbl_in
Expand All @@ -214,8 +214,8 @@ spec_arrow_append_table_arrow <- list(
)
},
#
arrow_append_table_arrow_roundtrip_64_bit_roundtrip = function(con, table_name) {
skip("Requires dbBind() on RMariaDB")
arrow_append_table_arrow_roundtrip_64_bit_roundtrip = function(ctx, con, table_name) {
skip_if_not_dbitest(ctx, "1.8.0.46")

tbl_in <- data.frame(a = c(-1e14, 1e15))
dbWriteTable(con, table_name, tbl_in, field.types = c(a = "BIGINT"))
Expand All @@ -224,8 +224,8 @@ spec_arrow_append_table_arrow <- list(
test_arrow_roundtrip(use_append = TRUE, con, tbl_out, tbl_expected = tbl_out)
},

arrow_append_table_arrow_roundtrip_character = function(con) {
skip("Requires dbBind() on RMariaDB")
arrow_append_table_arrow_roundtrip_character = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.45")

#' - character (in both UTF-8
tbl_in <- data.frame(
Expand All @@ -236,8 +236,8 @@ spec_arrow_append_table_arrow <- list(
test_arrow_roundtrip(use_append = TRUE, con, tbl_in)
},

arrow_append_table_arrow_roundtrip_character_native = function(con) {
skip("Requires dbBind() on RMariaDB")
arrow_append_table_arrow_roundtrip_character_native = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.44")

#' and native encodings),
tbl_in <- data.frame(
Expand Down Expand Up @@ -265,8 +265,8 @@ spec_arrow_append_table_arrow <- list(
test_arrow_roundtrip(use_append = TRUE, con, tbl_in)
},

arrow_append_table_arrow_roundtrip_factor = function(con) {
skip("Failed in SQLite")
arrow_append_table_arrow_roundtrip_factor = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.43")

#' - factor (returned as character,
tbl_in <- data.frame(
Expand All @@ -283,7 +283,7 @@ spec_arrow_append_table_arrow <- list(
},

arrow_append_table_arrow_roundtrip_raw = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.42")

#' - list of raw
#' (if supported by the database)
Expand All @@ -305,7 +305,7 @@ spec_arrow_append_table_arrow <- list(
},

arrow_append_table_arrow_roundtrip_blob = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.41")

#' - objects of type [blob::blob]
#' (if supported by the database)
Expand Down Expand Up @@ -435,7 +435,7 @@ spec_arrow_append_table_arrow <- list(
},

arrow_append_table_arrow_roundtrip_timestamp_extended = function(ctx, con) {
skip("Fails in RPostgres and RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.40")

#' also for timestamps prior to 1970 or 1900 or after 2038
if (!isTRUE(ctx$tweaks$timestamp_typed)) {
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-create-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#' @format NULL
#' @keywords NULL
spec_arrow_create_table_arrow <- list(
arrow_create_table_arrow_formals = function() {
skip("Failed in SQLite")
arrow_create_table_arrow_formals = function(ctx) {
skip_if_not_dbitest(ctx, "1.8.0.13")

# <establish formals of described functions>
expect_equal(names(formals(dbCreateTableArrow)), c("conn", "name", "value", "...", "temporary"))
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-fetch-arrow-chunk.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ spec_arrow_fetch_arrow_chunk <- list(
},

#'
arrow_fetch_arrow_chunk_closed = function(con) {
skip("Fails in adbc")
arrow_fetch_arrow_chunk_closed = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.11")

#' @section Failure modes:
#' An attempt to fetch from a closed result set raises an error.
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-fetch-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ spec_arrow_fetch_arrow <- list(
},

#'
arrow_fetch_arrow_closed = function(con) {
skip("Fails in adbc")
arrow_fetch_arrow_closed = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.15")

#' @section Failure modes:
#' An attempt to fetch from a closed result set raises an error.
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-get-query-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ spec_arrow_get_query_arrow <- list(
expect_identical(rows, result)
},

arrow_get_query_arrow_zero_rows = function(con) {
skip("Causes segfault in adbc")
arrow_get_query_arrow_zero_rows = function(ctx, con) {
skip_if_not_dbitest(ctx, "1.8.0.12")

#' or zero rows.
# Not all SQL dialects seem to support the query used here.
Expand Down
2 changes: 1 addition & 1 deletion R/spec-arrow-read-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec_arrow_read_table_arrow <- list(
},

arrow_read_table_arrow_empty = function(ctx, con, table_name) {
skip("Causes segfault in adbc and duckdb")
skip_if_not_dbitest(ctx, "1.8.0.14")

#' @return
#' An empty table is returned as an Arrow object with zero rows.
Expand Down
52 changes: 26 additions & 26 deletions R/spec-arrow-write-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ spec_arrow_write_table_arrow <- list(
},

#'
arrow_write_table_arrow_error_overwrite = function(con, table_name) {
skip("Failed in SQLite")
arrow_write_table_arrow_error_overwrite = function(ctx, con, table_name) {
skip_if_not_dbitest(ctx, "1.8.0.39")

#' @section Failure modes:
#' If the table exists, and both `append` and `overwrite` arguments are unset,
Expand Down Expand Up @@ -54,7 +54,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_error = function(ctx, con, table_name) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.38")

#' An error is also raised
test_in <- stream_frame(a = 1L)
Expand Down Expand Up @@ -190,7 +190,7 @@ spec_arrow_write_table_arrow <- list(

#'
arrow_write_table_arrow_overwrite = function(ctx, con, table_name) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.37")

#' If the `overwrite` argument is `TRUE`, an existing table of the same name
#' will be overwritten.
Expand All @@ -205,7 +205,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_overwrite_missing = function(ctx, con, table_name) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.36")

#' This argument doesn't change behavior if the table does not exist yet.
penguins_in <- get_penguins(ctx)
Expand All @@ -219,7 +219,7 @@ spec_arrow_write_table_arrow <- list(

#'
arrow_write_table_arrow_append = function(ctx, con, table_name) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.35")

#' If the `append` argument is `TRUE`, the rows in an existing table are
#' preserved, and the new data are appended.
Expand All @@ -231,7 +231,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_append_new = function(ctx, con, table_name) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.34")

#' If the table doesn't exist yet, it is created.
penguins <- get_penguins(ctx)
Expand All @@ -242,7 +242,7 @@ spec_arrow_write_table_arrow <- list(

#'
arrow_write_table_arrow_temporary = function(ctx, con, table_name = "dbit08") {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.33")

#' If the `temporary` argument is `TRUE`, the table is not available in a
#' second connection and is gone after reconnecting.
Expand All @@ -261,7 +261,7 @@ spec_arrow_write_table_arrow <- list(
},
# second stage
arrow_write_table_arrow_temporary = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.32")

if (!isTRUE(ctx$tweaks$temporary_tables)) {
skip("tweak: temporary_tables")
Expand All @@ -272,7 +272,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_visible_in_other_connection = function(ctx, local_con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.31")

#' A regular, non-temporary table is visible in a second connection,
penguins30 <- get_penguins(ctx)
Expand All @@ -288,7 +288,7 @@ spec_arrow_write_table_arrow <- list(
},
# second stage
arrow_write_table_arrow_visible_in_other_connection = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.30")

#' in a pre-existing connection,
penguins30 <- get_penguins(ctx)
Expand All @@ -299,7 +299,7 @@ spec_arrow_write_table_arrow <- list(
},
# third stage
arrow_write_table_arrow_visible_in_other_connection = function(ctx, local_con, table_name = "dbit09") {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.29")

#' and after reconnecting to the database.
penguins30 <- get_penguins(ctx)
Expand All @@ -309,7 +309,7 @@ spec_arrow_write_table_arrow <- list(

#'
arrow_write_table_arrow_roundtrip_keywords = function(ctx, con) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.28")

#' SQL keywords can be used freely in table names, column names, and data.
tbl_in <- data.frame(
Expand All @@ -320,7 +320,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_quotes = function(ctx, con, table_name) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.27")

#' Quotes, commas, spaces, and other special characters such as newlines and tabs,
#' can also be used in the data,
Expand Down Expand Up @@ -360,7 +360,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_quotes_column_names = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.26")

#' and column names.
skip_if_not_dbitest(ctx, "1.7.2")
Expand Down Expand Up @@ -399,7 +399,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_logical = function(ctx, con) {
skip("Fails in adbc")
skip_if_not_dbitest(ctx, "1.8.0.25")

#' - logical
tbl_in <- data.frame(a = c(TRUE, FALSE, NA))
Expand Down Expand Up @@ -434,7 +434,7 @@ spec_arrow_write_table_arrow <- list(
},
#
arrow_write_table_arrow_roundtrip_64_bit_character = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.24")

tbl_in <- data.frame(a = c(-1e14, 1e15))
tbl_exp <- tbl_in
Expand All @@ -450,8 +450,8 @@ spec_arrow_write_table_arrow <- list(
)
},
#
arrow_write_table_arrow_roundtrip_64_bit_roundtrip = function(con, table_name) {
skip("Failed in SQLite")
arrow_write_table_arrow_roundtrip_64_bit_roundtrip = function(ctx, con, table_name) {
skip_if_not_dbitest(ctx, "1.8.0.23")

tbl_in <- data.frame(a = c(-1e14, 1e15))
dbWriteTableArrow(con, table_name, tbl_in, field.types = c(a = "BIGINT"))
Expand All @@ -461,7 +461,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_character = function(ctx, con) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.22")

#' - character (in both UTF-8
tbl_in <- data.frame(
Expand All @@ -473,7 +473,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_character_native = function(ctx, con) {
skip("Requires dbBind() on RMariaDB")
skip_if_not_dbitest(ctx, "1.8.0.21")

#' and native encodings),
tbl_in <- data.frame(
Expand Down Expand Up @@ -502,7 +502,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_factor = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.20")

#' - factor (returned as character)
tbl_in <- data.frame(
Expand All @@ -514,7 +514,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_raw = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.19")

#' - list of raw
#' (if supported by the database)
Expand All @@ -535,7 +535,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_blob = function(ctx, con) {
skip("Failed in SQLite")
skip_if_not_dbitest(ctx, "1.8.0.18")

#' - objects of type [blob::blob]
#' (if supported by the database)
Expand Down Expand Up @@ -626,7 +626,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_timestamp = function(ctx, con) {
skip("Fails in adbc")
skip_if_not_dbitest(ctx, "1.8.0.17")

#' - timestamp
#' (if supported by the database;
Expand Down Expand Up @@ -663,7 +663,7 @@ spec_arrow_write_table_arrow <- list(
},

arrow_write_table_arrow_roundtrip_timestamp_extended = function(ctx, con) {
skip("Fails in adbc")
skip_if_not_dbitest(ctx, "1.8.0.16")

#' also for timestamps prior to 1970 or 1900 or after 2038
if (!isTRUE(ctx$tweaks$timestamp_typed)) {
Expand Down

0 comments on commit 4a7dd72

Please sign in to comment.