Skip to content

Commit

Permalink
More changes to occasional CI (#6138)
Browse files Browse the repository at this point in the history
* More changes to occasional CI

* R 4.1.0 lambda snuck in

* Declare UTF-8 encoding in DESCRIPTION

* add with_c_collate() in case it's needed, not used yet

* Adapt to potential build failure
  • Loading branch information
MichaelChirico authored May 17, 2024
1 parent c8c35f3 commit 2b52437
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
schedule:
- cron: '18 13 11 * *' # 11th of month at 13:18 UTC
- cron: '17 13 18 * *' # 18th of month at 13:17 UTC

# A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release
name: R-CMD-check-occasional
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
if: matrix.os != 'windows-latest' && matrix.os != 'macOS-latest'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y libcurl4-openssl-dev libudunits2-dev
- name: Query dependencies
run: |
Expand Down Expand Up @@ -134,7 +134,9 @@ jobs:
} else {
Rbin = if (.Platform$OS.type == "windows") "R.exe" else "R"
system2(Rbin, c("CMD", "build", "."))
res = system2(Rbin, c("CMD", "check", "data.table_*.tar.gz", args), stdout=TRUE)
dt_tar <- list.files(pattern = "^data[.]table_.*[.]tar[.]gz$")
if (!length(dt_tar)) stop("Built tar.gz not found among: ", toString(list.files()))
res = system2(Rbin, c("CMD", "check", dt_tar[1L], args), stdout=TRUE)
if (!is.null(attr(res, "status")) || grep("^Status:.*(ERROR|WARNING)", res)) {
writeLines(res)
stop("R CMD check failed")
Expand Down
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ License: MPL-2.0 | file LICENSE
URL: https://r-datatable.com, https://Rdatatable.gitlab.io/data.table, https://github.com/Rdatatable/data.table
BugReports: https://github.com/Rdatatable/data.table/issues
VignetteBuilder: knitr
Encoding: UTF-8
ByteCompile: TRUE
Authors@R: c(
person("Tyson","Barrett", role=c("aut","cre"), email="[email protected]"),
Expand Down
10 changes: 10 additions & 0 deletions inst/tests/nafill.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ for (s in sugg) {
if (!loaded) cat("\n**** Suggested package",s,"is not installed or has dependencies missing. Tests using it will be skipped.\n\n")
}

# Ensure an operation uses C-locale sorting (#3502). For test set-ups/comparisons that use base operations, which are
# susceptible to locale-specific sorting issues, but shouldn't be needed for data.table code, which always uses C sorting.
# TODO(R>=3.3.0): use order(method="radix") as a way to avoid needing this helper
with_c_collate = function(expr) {
old = Sys.getlocale("LC_COLLATE")
on.exit(Sys.setlocale("LC_COLLATE", old))
Sys.setlocale("LC_COLLATE", "C")
expr
}

x = 1:10
x[c(1:2, 5:6, 9:10)] = NA
test(1.01, nafill(x, "locf"), INT(NA,NA,3,4,4,4,7,8,8,8))
Expand Down
2 changes: 1 addition & 1 deletion inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -18380,7 +18380,7 @@ test(2250.10, dt[1:2, paste(names(.SD), 'max', sep = '_') := lapply(.SD, max), b
test(2250.11, dt[, names(.SD(2)) := lapply(.SD, .I)], error=base_messages$missing_function('.SD'))

dt = data.table(a = 1:3, b = 5:7, grp = c('a', 'a', 'b'))
test(2250.12, dt[, names(.SD) := lapply(.SD, \(x) x + b), .SDcols = "a"], data.table(a = 1:3 + 5:7, b = 5:7, grp = c('a', 'a', 'b')))
test(2250.12, dt[, names(.SD) := lapply(.SD, function(x) x + b), .SDcols = "a"], data.table(a = 1:3 + 5:7, b = 5:7, grp = c('a', 'a', 'b')))


dt = data.table(a = 1L, b = 2L, c = 3L, d = 4L, e = 5L, f = 6L)
Expand Down

0 comments on commit 2b52437

Please sign in to comment.