Skip to content

Commit

Permalink
ensure quiet nixlibs.R tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Nov 8, 2023
1 parent ff398ed commit 0f2783f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ exit <- function(..., .status = 1) {

# checks the nightly repo for the latest nightly version X.Y.Z.100<dev>
find_latest_nightly <- function(description_version,
list_uri = "https://nightlies.apache.org/arrow/r/src/contrib/PACKAGES") {
list_uri = "https://nightlies.apache.org/arrow/r/src/contrib/PACKAGES",
hush = quietly) {
if (!startsWith(arrow_repo, "https://nightlies.apache.org/arrow/r")) {
lg("Detected non standard dev repo: %s, not checking latest nightly version.", arrow_repo)
return(description_version)
Expand Down Expand Up @@ -68,7 +69,7 @@ find_latest_nightly <- function(description_version,
versions <- versions[matching_major]
versions[[length(versions)]]
},
silent = quietly
silent = hush
)

if (inherits(res, "try-error")) {
Expand Down Expand Up @@ -848,16 +849,19 @@ quietly <- !env_is("ARROW_R_DEV", "true")

not_cran <- env_is("NOT_CRAN", "true")

if (is_release & !test_mode) {
if (is_release) {
VERSION <- VERSION[1, 1:3]
arrow_repo <- paste0(getOption("arrow.repo", sprintf("https://apache.jfrog.io/artifactory/arrow/r/%s", VERSION)), "/libarrow/")
} else if(!test_mode) {
} else {
not_cran <- TRUE
arrow_repo <- paste0(getOption("arrow.dev_repo", "https://nightlies.apache.org/arrow/r"), "/libarrow/")
}

if (!is_release && !test_mode) {
VERSION <- find_latest_nightly(VERSION)
}

# To collect dirs to rm on exit, use del() to add dirs
# To collect dirs to rm on exit, use cleanup() to add dirs
# we reset it to avoid errors on reruns in the same session.
options(.arrow.cleanup = character())
on.exit(unlink(getOption(".arrow.cleanup"), recursive = TRUE), add = TRUE)
Expand Down
3 changes: 2 additions & 1 deletion r/tools/test-nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ test_that("find_latest_nightly()", {
suppressWarnings(
find_latest_nightly(
package_version("15.0.0.9000"),
list_uri = "this is not a URI"
list_uri = "this is not a URI",
hush = TRUE
)
),
package_version("15.0.0.9000")
Expand Down

0 comments on commit 0f2783f

Please sign in to comment.