Skip to content

Commit

Permalink
Continued ci-occasional debugging: tracing error (#6147)
Browse files Browse the repository at this point in the history
* Update other.Rraw

* tweak approach for reading env

* speculatively define isFALSE
  • Loading branch information
MichaelChirico authored May 21, 2024
1 parent 0da9496 commit de515da
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ jobs:
run: |
options(crayon.enabled = TRUE)
# we define this in data.table namespace, but it appears to be exec
if (!exists("isFALSE", "package:base")) {
if (!exists("isFALSE", asNamespace("data.table"))) {
cat("isFALSE not found in base, but data.table did not define it either!\n")
}
# attempt defining it here as a workaround...
isFALSE = function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x
}
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
pkgs <- get(as.character(other_deps_expr[[1L]][[2L]]))
Expand Down
7 changes: 6 additions & 1 deletion inst/tests/other.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ f = function(pkg) suppressWarnings(suppressMessages(isTRUE(
)))
loaded = sapply(pkgs, f)
if (!all(loaded)) {
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.")
options(warning.length=8000)
stop(
"test.data.table('other.Rraw') failed to attach required package(s): ", toString(names(loaded)[!loaded]), ".",
"\nHere's all installed packages:\n ", paste(rownames(installed.packages()), collapse=","),
"\nHere's the search() path:\n ", paste(search(), collapse="->"),
"\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>"), ".")
# Would like to install them now for convenience but gitlab-ci.yml seems to install to bus/mirror-other-packages/cran.
# 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.
# 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.
Expand Down
2 changes: 1 addition & 1 deletion tests/other.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
library(data.table)
if (!as.logical(Sys.getenv("TEST_DATA_TABLE_WITH_OTHER_PACKAGES", "FALSE"))) {
if (!isTRUE(as.logical(Sys.getenv("TEST_DATA_TABLE_WITH_OTHER_PACKAGES")))) {
cat("Skipping tests in 'other' and quitting, set TEST_DATA_TABLE_WITH_OTHER_PACKAGES to proceed.\n")
q('no')
}
Expand Down

0 comments on commit de515da

Please sign in to comment.