Skip to content
Open
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
16 changes: 15 additions & 1 deletion .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on:
push:
schedule:
- cron: '17 13 23 * *' # 23rd of month at 13:17 UTC
workflow_dispatch:
Expand Down Expand Up @@ -75,9 +76,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev pandoc

- name: Install R Package Build Dependencies on MacOS
if: matrix.os == 'macOS-latest'
uses: r-hub/actions/setup-r-sysreqs@v1
with:
type: 'minimal'

- name: Install check dependencies (macOS)
if: matrix.os == 'macOS-latest'
run: brew install gdal proj
run: |
brew install gdal proj gettext
brew link --force gettext

- name: Check
env:
Expand Down Expand Up @@ -106,6 +115,11 @@ jobs:
message(sprintf("Skipping other.Rraw since some required packages are not available: %s\n", toString(other_pkgs[!has_other_pkg])))
}
message("Will try and set TEST_DATA_TABLE_WITH_OTHER_PACKAGES=", as.character(run_other), " in R CMD check.")
if (run_other) {
desc = read.dcf("DESCRIPTION")
desc[1L, "Suggests"] = toString(unique(c(desc[1, "Suggests"], other_pkgs)))
write.dcf(desc, "DESCRIPTION")
}
# IINM rcmdcheck isolates its env from the calling process', besides what's passed to env=
env = c(
TEST_DATA_TABLE_WITH_OTHER_PACKAGES=as.character(run_other)
Expand Down
20 changes: 14 additions & 6 deletions R/test.data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -671,22 +671,30 @@ test = function(num, x, y=TRUE,
# nocov start
if (!fail) {
catf("Test %s ran without errors but failed check that x equals y:\n", numStr)
failPrint = function(x, xsub) {
cat(">", substitute(x), "=", xsub, "\n") # notranslate
failPrint = function(x, diff_idx, xsub) {
label = substitute(x)
cat(">", label, "=", xsub, "\n") # notranslate
if (is.data.table(x)) compactprint(x) else {
nn = length(x)
catf("First %d of %d (type '%s'): \n", min(nn, 6L), length(x), typeof(x))
if (is.atomic(x)) {
total = length(x)
x = x[diff_idx] # careful to only evaluate '!=' in diff_idx for atomic inputs
names(x) = sprintf("%s[%d]", as.character(label), which(diff_idx))
catf("First %d different of %d (%d total, type '%s'): \n", min(nn, 6L), length(x), total, typeof(x))
} else {
catf("First %d of %d (type '%s'): \n", min(nn, 6L), length(x), typeof(x))
}
# head.matrix doesn't restrict columns
if (length(d <- dim(x))) do.call(`[`, c(list(x, drop = FALSE), lapply(pmin(d, 6L), seq_len)))
if (length(d <- dim(x))) print(do.call(`[`, c(list(x, drop = FALSE), lapply(pmin(d, 6L), seq_len))))
else print(head(x))
if (typeof(x) == 'character' && anyNonAscii(x)) {
catf("Non-ASCII string detected, raw representation:\n")
print(lapply(head(x), charToRaw))
}
}
}
failPrint(x, deparse(xsub))
failPrint(y, deparse(ysub))
failPrint(x, x!=y, deparse(xsub))
failPrint(y, x!=y, deparse(ysub))
if (!isTRUE(all.equal.result)) cat(all.equal.result, sep="\n")
fail = TRUE
}
Expand Down
Loading