Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions r/tests/testthat/helper-skip.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ skip_on_linux_devel <- function() {
}
}

skip_if_r_version <- function(r_version) {
skip_on_r_older_than <- function(r_version) {
if (force_tests()) {
return()
}

if (getRversion() <= r_version) {
if (getRversion() < r_version) {
skip(paste("R version:", getRversion()))
}
}
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-Array.R
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ test_that("Handling string data with embedded nuls", {
# The behavior of the warnings/errors is slightly different with and without
# altrep. Without it (i.e. 3.5.0 and below, the error would trigger immediately
# on `as.vector()` where as with it, the error only happens on materialization)
skip_if_r_version("3.5.0")
skip_on_r_older_than("3.6")

# no error on conversion, because altrep laziness
v <- expect_error(as.vector(array_with_nul), NA)
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-RecordBatch.R
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ test_that("Handling string data with embedded nuls", {
# The behavior of the warnings/errors is slightly different with and without
# altrep. Without it (i.e. 3.5.0 and below, the error would trigger immediately
# on `as.vector()` where as with it, the error only happens on materialization)
skip_if_r_version("3.5.0")
skip_on_r_older_than("3.6")
df <- as.data.frame(batch_with_nul)

expect_error(
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-altrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

skip_if_r_version("3.5.0")
skip_on_r_older_than("3.6")

test_that("is_arrow_altrep() does not include base altrep", {
expect_false(is_arrow_altrep(1:10))
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-chunked-array.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ test_that("Handling string data with embedded nuls", {
# The behavior of the warnings/errors is slightly different with and without
# altrep. Without it (i.e. 3.5.0 and below, the error would trigger immediately
# on `as.vector()` where as with it, the error only happens on materialization)
skip_if_r_version("3.5.0")
skip_on_r_older_than("3.6")

v <- expect_error(as.vector(chunked_array_with_nul), NA)

Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ test_that("more informative error when reading a CSV with headers and schema", {
test_that("read_csv_arrow() and write_csv_arrow() accept connection objects", {
# connections with csv need RunWithCapturedR, which is not available
# in R <= 3.4.4
skip_if_r_version("3.4.4")
skip_on_r_older_than("3.5")

tf <- tempfile()
on.exit(unlink(tf))
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-dplyr-funcs-datetime.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

skip_if(on_old_windows())
# In 3.4 the lack of tzone attribute causes spurious failures
skip_if_r_version("3.4.4")
skip_on_r_older_than("3.5")

library(lubridate, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-dplyr-funcs-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ test_that("format date/time", {
withr::local_locale(LC_TIME = "C")
}
# In 3.4 the lack of tzone attribute causes spurious failures
skip_if_r_version("3.4.4")
skip_on_r_older_than("3.5")

times <- tibble(
datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA),
Expand Down
5 changes: 5 additions & 0 deletions r/tests/testthat/test-dplyr-glimpse.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
# specific language governing permissions and limitations
# under the License.

# The glimpse output for tests with `example_data` is different on R < 3.6
# because the `lgl` column is generated with `sample()` and the RNG
# algorithm is different in older R versions.
skip_on_r_older_than("3.6")

library(dplyr, warn.conflicts = FALSE)

test_that("glimpse() Table/ChunkedArray", {
Expand Down
3 changes: 3 additions & 0 deletions r/tests/testthat/test-dplyr-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ test_that("No duplicate field names are allowed in an arrow_dplyr_query", {
})

test_that("all_sources() finds all data sources in a query", {
skip_if_not_available("dataset")
tab <- Table$create(a = 1)
ds <- InMemoryDataset$create(tab)
expect_equal(all_sources(tab), list(tab))
Expand Down Expand Up @@ -333,6 +334,7 @@ test_that("all_sources() finds all data sources in a query", {
})

test_that("query_on_dataset() looks at all data sources in a query", {
skip_if_not_available("dataset")
tab <- Table$create(a = 1)
ds <- InMemoryDataset$create(tab)
expect_false(query_on_dataset(tab))
Expand Down Expand Up @@ -368,6 +370,7 @@ test_that("query_on_dataset() looks at all data sources in a query", {
})

test_that("query_can_stream()", {
skip_if_not_available("dataset")
tab <- Table$create(a = 1)
ds <- InMemoryDataset$create(tab)
expect_true(query_can_stream(tab))
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-feather.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ test_that("read_feather() and write_feather() accept connection objects", {
skip_if(on_old_windows())
# connections with feather need RunWithCapturedR, which is not available
# in R <= 3.4.4
skip_if_r_version("3.4.4")
skip_on_r_older_than("3.5")

tf <- tempfile()
on.exit(unlink(tf))
Expand Down
4 changes: 2 additions & 2 deletions r/tests/testthat/test-safe-call-into-r.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test_that("SafeCallIntoR works from the main R thread", {
})

test_that("SafeCallIntoR works within RunWithCapturedR", {
skip_if_r_version("3.4.4")
skip_on_r_older_than("3.5")
skip_on_cran()

expect_identical(
Expand All @@ -47,7 +47,7 @@ test_that("SafeCallIntoR works within RunWithCapturedR", {
})

test_that("SafeCallIntoR errors from the non-R thread", {
skip_if_r_version("3.4.4")
skip_on_r_older_than("3.5")
skip_on_cran()

expect_error(
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-scalar.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test_that("Handling string data with embedded nuls", {
# The behavior of the warnings/errors is slightly different with and without
# altrep. Without it (i.e. 3.5.0 and below, the error would trigger immediately
# on `as.vector()` where as with it, the error only happens on materialization)
skip_if_r_version("3.5.0")
skip_on_r_older_than("3.6")
v <- expect_error(as.vector(scalar_with_nul), NA)
expect_error(
v[1],
Expand Down