Skip to content

Commit 629c26c

Browse files
committed
test: ensure be able to install duckdb extensions on release version
1 parent c027346 commit 629c26c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/testthat/helper-skip.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# https://github.com/r-lib/testthat/issues/2236
2+
skip_on_dev_version <- function() {
3+
version <- asNamespace(testing_package())[[".__NAMESPACE__."]][["spec"]][[
4+
"version"
5+
]] |>
6+
package_version() |>
7+
unclass() |>
8+
getElement(1L)
9+
10+
if (length(version) < 3 || tail(version, 1L) < 9000) {
11+
invisible()
12+
} else {
13+
skip("Skip on development versions.")
14+
}
15+
}
16+
17+
# Skip on CRAN, but run on R-universe
18+
skip_on_cran_except_r_universe <- function() {
19+
if (!nzchar(Sys.getenv("MY_UNIVERSE"))) {
20+
skip_on_cran()
21+
}
22+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
test_that("Install DuckDB extension", {
2+
skip_on_dev_version()
3+
skip_on_cran_except_r_universe()
4+
5+
expect_no_error(sql("INSTALL icu"))
6+
})

0 commit comments

Comments
 (0)