Skip to content

Commit

Permalink
Re-add silencing of rosetta detection, move test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkeane committed Oct 12, 2023
1 parent 19684dd commit dfec06a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
5 changes: 3 additions & 2 deletions r/R/install-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ wslify_path <- function(path) {
}

on_rosetta <- function() {
# make sure to suppress warnings and ignore the stderr so that this is silent where proc_translated doesn't exist
identical(tolower(Sys.info()[["sysname"]]), "darwin") &&
identical(system("sysctl -n sysctl.proc_translated", intern = TRUE), "1")
}
identical(suppressWarnings(system("sysctl -n sysctl.proc_translated", intern = TRUE, ignore.stderr = TRUE)), "1")
}
21 changes: 0 additions & 21 deletions r/tests/testthat/test-arrow-pacakge.R

This file was deleted.

5 changes: 5 additions & 0 deletions r/tests/testthat/test-install-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ test_that("arrow_repos", {
expect_identical(arrow_repos(c(ours, other), nightly = TRUE), c(ours, other))
})
})

test_that("on_rosetta() does not warn", {
# There is no warning
expect_warning(on_rosetta(), NA)
})

0 comments on commit dfec06a

Please sign in to comment.