Skip to content

Commit 6bb56e4

Browse files
committed
fix: Don't run tests that invoke re2 by default
1 parent 5257514 commit 6bb56e4

File tree

10 files changed

+33
-3
lines changed

10 files changed

+33
-3
lines changed

R/backend-dbplyr__duckdb_connection.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#'
88
#' @name backend-duckdb
99
#' @aliases NULL
10-
#' @examplesIf rlang::is_installed("dbplyr")
10+
#' @examplesIf duckdb:::TEST_RE2 && rlang::is_installed("dbplyr")
1111
#' library(dplyr, warn.conflicts = FALSE)
1212
#' con <- DBI::dbConnect(duckdb(), path = ":memory:")
1313
#'

R/csv.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' @param ... Passed on to [read.csv()]
1818
#' @return The number of rows in the resulted table, invisibly.
1919
#' @export
20-
#' @examples
20+
#' @examplesIf duckdb:::TEST_RE2
2121
#' con <- dbConnect(duckdb())
2222
#'
2323
#' data <- data.frame(a = 1:3, b = letters[1:3])

R/re2.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set to TRUE to run tests that have triggered re2 in the past
2+
TEST_RE2 <- FALSE

man/backend-duckdb.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/duckdb_read_csv.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-DBItest.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
skip_on_cran()
22

33
if (rlang::is_installed("DBItest")) DBItest::test_all(c(
4+
if (!TEST_RE2) c(
5+
"list_tables",
6+
"list_tables_quote",
7+
"list_fields_object",
8+
"list_objects",
9+
"list_objects_quote",
10+
"list_objects_features",
11+
"remove_table_list",
12+
"remove_table_other_con",
13+
"exists_table_list"
14+
),
15+
416
"package_name", # wontfix
517
"package_dependencies", # wontfix
618
"reexport", # wontfix

tests/testthat/test-multi_statement.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ test_that("statements can be splitted apart correctly", {
3838
})
3939

4040
test_that("export/import database works", {
41+
skip_if_not(TEST_RE2)
42+
4143
export_location <- file.path(tempdir(), "duckdb_test_export")
4244
if (!file.exists(export_location)) dir.create(export_location)
4345

tests/testthat/test-read.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
test_that("duckdb_read_csv() works as expected", {
2+
skip_if_not(TEST_RE2)
3+
24
con <- dbConnect(duckdb())
35

46
tf <- tempfile()

tests/testthat/test-rel_api.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8214,6 +8214,8 @@ test_that("relational mutate(c = 10, d = log10(c)) order-preserving", {
82148214
})
82158215

82168216
test_that("relational mutate(c = NA_character_, d = grepl('.', c)) order-preserving", {
8217+
skip_if_not(TEST_RE2)
8218+
82178219
# Autogenerated
82188220
con <- dbConnect(duckdb())
82198221
experimental <- FALSE
@@ -11254,6 +11256,8 @@ test_that("relational mutate(c = 10, d = log10(c)) order-enforcing", {
1125411256
})
1125511257

1125611258
test_that("relational mutate(c = NA_character_, d = grepl('.', c)) order-enforcing", {
11259+
skip_if_not(TEST_RE2)
11260+
1125711261
# Autogenerated
1125811262
con <- dbConnect(duckdb())
1125911263
experimental <- FALSE

tests/testthat/test-viewer.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
test_that("rs_list_object_types", {
2+
skip_if_not(TEST_RE2)
3+
24
con <- dbConnect(duckdb())
35
on.exit(dbDisconnect(con, shutdown = TRUE))
46

@@ -12,6 +14,8 @@ test_that("rs_list_object_types", {
1214
})
1315

1416
test_that("rs_list_objects", {
17+
skip_if_not(TEST_RE2)
18+
1519
con <- dbConnect(duckdb())
1620
on.exit(dbDisconnect(con, shutdown = TRUE))
1721

@@ -30,6 +34,8 @@ test_that("rs_list_objects", {
3034
})
3135

3236
test_that("rs_list_columns", {
37+
skip_if_not(TEST_RE2)
38+
3339
con <- dbConnect(duckdb())
3440
on.exit(dbDisconnect(con, shutdown = TRUE))
3541

0 commit comments

Comments
 (0)