From 747b59e06c158c70ead81f5ca8191d1250def8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Wed, 8 Nov 2023 10:30:39 +0100 Subject: [PATCH 1/2] test: Fix checks without suggested packages --- R/context.R | 21 ++++++++++++++++++++- examples/make_context.R | 19 ------------------- man/context.Rd | 2 ++ 3 files changed, 22 insertions(+), 20 deletions(-) delete mode 100644 examples/make_context.R diff --git a/R/context.R b/R/context.R index cba52b6a0..f08809799 100644 --- a/R/context.R +++ b/R/context.R @@ -23,7 +23,26 @@ #' @rdname context #' @importFrom methods is new #' @export -#' @example examples/make_context.R +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) +#' make_context( +#' new( +#' "DBIConnector", +#' .drv = RSQLite::SQLite(), +#' .conn_args = list(dbname = tempfile("DBItest", fileext = ".sqlite")) +#' ), +#' tweaks = tweaks( +#' constructor_relax_args = TRUE, +#' placeholder_pattern = c("?", "$1", "$name", ":name"), +#' date_cast = function(x) paste0("'", x, "'"), +#' time_cast = function(x) paste0("'", x, "'"), +#' timestamp_cast = function(x) paste0("'", x, "'"), +#' logical_return = function(x) as.integer(x), +#' date_typed = FALSE, +#' time_typed = FALSE, +#' timestamp_typed = FALSE +#' ), +#' default_skip = c("roundtrip_date", "roundtrip_timestamp") +#' ) make_context <- function(drv, connect_args = NULL, set_as_default = TRUE, tweaks = NULL, name = NULL, default_skip = NULL) { if (is.null(drv)) { diff --git a/examples/make_context.R b/examples/make_context.R deleted file mode 100644 index 3a5c55ae1..000000000 --- a/examples/make_context.R +++ /dev/null @@ -1,19 +0,0 @@ -make_context( - new( - "DBIConnector", - .drv = RSQLite::SQLite(), - .conn_args = list(dbname = tempfile("DBItest", fileext = ".sqlite")) - ), - tweaks = tweaks( - constructor_relax_args = TRUE, - placeholder_pattern = c("?", "$1", "$name", ":name"), - date_cast = function(x) paste0("'", x, "'"), - time_cast = function(x) paste0("'", x, "'"), - timestamp_cast = function(x) paste0("'", x, "'"), - logical_return = function(x) as.integer(x), - date_typed = FALSE, - time_typed = FALSE, - timestamp_typed = FALSE - ), - default_skip = c("roundtrip_date", "roundtrip_timestamp") -) diff --git a/man/context.Rd b/man/context.Rd index 02fcd1834..2efc8cd7b 100644 --- a/man/context.Rd +++ b/man/context.Rd @@ -49,6 +49,7 @@ to \code{\link[=test_all]{test_all()}} and other testing functions.} Create a test context, set and query the default context. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} make_context( new( "DBIConnector", @@ -68,4 +69,5 @@ make_context( ), default_skip = c("roundtrip_date", "roundtrip_timestamp") ) +\dontshow{\}) # examplesIf} } From 7164f167c6e3d7bfa4582071bf0c23d3fb426a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Wed, 8 Nov 2023 14:04:54 +0100 Subject: [PATCH 2/2] Fix duckdb check on CI --- revdep-dev/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/revdep-dev/Makefile b/revdep-dev/Makefile index 32ddcbf1a..a5f195281 100644 --- a/revdep-dev/Makefile +++ b/revdep-dev/Makefile @@ -3,7 +3,7 @@ all: test TESTTHAT_REPORTER ?= testthat::ProgressReporter\$$new(max_failures = Inf, update_interval = Inf) # The REVDEP definition also decides what is run on GitHub Actions in backends.yaml -REVDEP := RMariaDB RSQLite RPostgres RKazam duckdb-r odbc-SQLServer odbc-MySQL odbc-PostgreSQL odbc-SQLite +REVDEP := RMariaDB RSQLite RPostgres RKazam duckdb odbc-SQLServer odbc-MySQL odbc-PostgreSQL odbc-SQLite TEST_TARGETS := $(patsubst %,test-%,${REVDEP}) LIB_DIR := $(shell Rscript -e "cat(.libPaths()[1])") @@ -18,9 +18,9 @@ RKazam RSQLite RPostgres RMySQL RMariaDB odbc: odbc-%: odbc @true -duckdb-r: +duckdb: # Use local checkout if available, otherwise clone from duckdb GitHub - if [ -d ../../$@ ]; then ln -s $$(realpath ../../$@) $@; else git clone https://github.com/duckdb/$@.git; fi + if [ -d ../../$@ ]; then ln -s $$(realpath ../../$@) $@; else git clone https://github.com/duckdb/$@-r.git $@; fi head $@/DESCRIPTION bigrquery: