Skip to content

Commit 8ae2781

Browse files
committed
Accommodate arm64 linux tests in continuous integration
1 parent 130ec69 commit 8ae2781

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.github/workflows/macos.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- {os: macos-latest}
1818
- {os: macos-13}
1919
#- {os: ubuntu-latest}
20+
- {os: ubuntu-24.04-arm}
2021

2122
runs-on: ${{ matrix.os }}
2223

ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2025-05-05 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/tinytest/test_sugar.R: Condition four NA-related tests away on
4+
arm64 on Linux too
5+
6+
* .github/workflows/macos.yaml (jobs): Add ubuntu-24.04-arm to matrix
7+
18
2025-04-15 Dirk Eddelbuettel <[email protected]>
29

310
* docker/ci-4.4/Dockerfile: Added based on r-base:4.4.3

inst/tinytest/test_sugar.R

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
## Copyright (C) 2010 - 2024 Dirk Eddelbuettel and Romain Francois
2+
## Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
33
## Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
44
##
55
## This file is part of Rcpp.
@@ -24,6 +24,8 @@ Rcpp::sourceCpp("cpp/sugar.cpp")
2424
## There are some (documented, see https://blog.r-project.org/2020/11/02/will-r-work-on-apple-silicon/index.html)
2525
## issues with NA propagation on arm64 / macOS. We not (yet ?) do anything special so we just skip some tests
2626
isArmMacOs <- Sys.info()[["sysname"]] == "Darwin" && Sys.info()[["machine"]] == "arm64"
27+
## This also seems to hit arm64 on Linux
28+
isArmLinux <- Sys.info()[["sysname"]] == "Linux" && Sys.info()[["machine"]] == "arm64"
2729

2830
## Needed for a change in R 3.6.0 reducing a bias in very large samples
2931
suppressWarnings(RNGversion("3.5.0"))
@@ -66,15 +68,15 @@ expect_true( ! fx( 1:10 ) )
6668
expect_true( fx( 6:10 ) )
6769
expect_true( fx( 5 ) )
6870
expect_true( ! fx( c(NA, 1) ) )
69-
if (!isArmMacOs) expect_true( is.na( fx( c(NA, 6) ) ) )
71+
if (!isArmMacOs && !isArmLinux) expect_true( is.na( fx( c(NA, 6) ) ) )
7072

7173

7274
# test.sugar.all.one.equal <- function( ){
7375
fx <- runit_all_one_equal
7476
expect_true( ! fx( 1 ) )
7577
expect_true( ! fx( 1:2 ) )
7678
expect_true( fx( rep(5,4) ) )
77-
if (!isArmMacOs) expect_true( is.na( fx( c(5,NA) ) ) )
79+
if (!isArmMacOs && !isArmLinux) expect_true( is.na( fx( c(5,NA) ) ) )
7880
expect_true(! fx( c(NA, 1) ) )
7981

8082

@@ -83,7 +85,7 @@ fx <- runit_all_not_equal_one
8385
expect_true( fx( 1 ) )
8486
expect_true( fx( 1:2 ) )
8587
expect_true( ! fx( 5 ) )
86-
if (!isArmMacOs) expect_true( is.na( fx( c(NA, 1) ) ) )
88+
if (!isArmMacOs && !isArmLinux) expect_true( is.na( fx( c(NA, 1) ) ) )
8789
expect_true( ! fx( c(NA, 5) ) )
8890

8991

@@ -1620,7 +1622,7 @@ expect_error(strimws(x[1], "invalid"), info = "strimws -- bad `which` argument")
16201622
## min/max
16211623
# test.sugar.min.max <- function() {
16221624
## min(empty) gives NA for integer, Inf for numeric (#844)
1623-
if (!isArmMacOs) expect_true(is.na(intmin(integer(0))), "min(integer(0))")
1625+
if (!isArmMacOs && !isArmLinux) expect_true(is.na(intmin(integer(0))), "min(integer(0))")
16241626
if (!isArmMacOs) expect_equal(doublemin(numeric(0)), Inf, info = "min(numeric(0))")
16251627

16261628
## max(empty_ gives NA for integer, Inf for numeric (#844)

0 commit comments

Comments
 (0)