Skip to content

Commit de515da

Browse files
Continued ci-occasional debugging: tracing error (#6147)
* Update other.Rraw * tweak approach for reading env * speculatively define isFALSE
1 parent 0da9496 commit de515da

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.github/workflows/R-CMD-check-occasional.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ jobs:
126126
run: |
127127
options(crayon.enabled = TRUE)
128128
129+
# we define this in data.table namespace, but it appears to be exec
130+
if (!exists("isFALSE", "package:base")) {
131+
if (!exists("isFALSE", asNamespace("data.table"))) {
132+
cat("isFALSE not found in base, but data.table did not define it either!\n")
133+
}
134+
# attempt defining it here as a workaround...
135+
isFALSE = function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x
136+
}
137+
129138
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
130139
eval(other_deps_expr)
131140
pkgs <- get(as.character(other_deps_expr[[1L]][[2L]]))

inst/tests/other.Rraw

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ f = function(pkg) suppressWarnings(suppressMessages(isTRUE(
2727
)))
2828
loaded = sapply(pkgs, f)
2929
if (!all(loaded)) {
30-
stop("test.data.table('other.Rraw') is missing required package(s): ", toString(names(loaded)[!loaded]), ". If you can't install them and this is R CMD check, please set environment variable TEST_DATA_TABLE_WITH_OTHER_PACKAGES back to the default, false.")
30+
options(warning.length=8000)
31+
stop(
32+
"test.data.table('other.Rraw') failed to attach required package(s): ", toString(names(loaded)[!loaded]), ".",
33+
"\nHere's all installed packages:\n ", paste(rownames(installed.packages()), collapse=","),
34+
"\nHere's the search() path:\n ", paste(search(), collapse="->"),
35+
"\nIf you can't install them and this is R CMD check, please set environment variable TEST_DATA_TABLE_WITH_OTHER_PACKAGES back to the default, false; it's currently ", Sys.getenv("TEST_DATA_TABLE_WITH_OTHER_PACKAGES", "<unset>"), ".")
3136
# Would like to install them now for convenience but gitlab-ci.yml seems to install to bus/mirror-other-packages/cran.
3237
# If that's a cache, that's nice, but we don't know at this point whether this script is being run by GLCI or by a user or in dev.
3338
# We don't allow skipping (e.g. if _R_CHECK_FORCE_SUGGESTS_ is FALSE) to keep things simple and to keep things strict; i.e.

tests/other.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
library(data.table)
2-
if (!as.logical(Sys.getenv("TEST_DATA_TABLE_WITH_OTHER_PACKAGES", "FALSE"))) {
2+
if (!isTRUE(as.logical(Sys.getenv("TEST_DATA_TABLE_WITH_OTHER_PACKAGES")))) {
33
cat("Skipping tests in 'other' and quitting, set TEST_DATA_TABLE_WITH_OTHER_PACKAGES to proceed.\n")
44
q('no')
55
}

0 commit comments

Comments
 (0)