Running ‘test-all.R’ [266s/332s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("SpaDES.core")
  Loading required package: SpaDES.core
  Loading required package: quickPlot
  Loading required package: reproducible
  
  Attaching package: 'reproducible'
  
  The following object is masked from 'package:testthat':
  
      %>%
  
  
  Attaching package: 'SpaDES.core'
  
  The following objects are masked from 'package:stats':
  
      end, start
  
    Using cached copy of .inputObjects event in test module. Adding to memoised copy.
    Using cached copy of .inputObjects event in test module. Adding to memoised copy.
    Using memoised copy of .inputObjects event in test module
    Using cached copy of .inputObjects event in test module. Adding to memoised copy.
  ── 1. Error: /tmp/RtmpUkaiKT/R.INSTALL5b2148f348c0/SpaDES.core/man/simList-acces
  invalid 'description' argument
  1: read.csv(dir(tmpdir, pattern = "year10.csv", full.name = TRUE))
  2: read.table(file = file, header = header, sep = sep, quote = quote, dec = dec, fill = fill, 
         comment.char = comment.char, ...)
  3: file(file, "rt")
  
  ── 2. Failure: experiment does not work correctly (@test-experiment.R#62)  ─────
  outputs(sims[[x]])$file not equal to `%>%`(...).
  2/2 mismatches
  x[1]: "/tmp/RtmpqFaq.1/UvRQNU/rep1/landscape_year2"
  y[1]: "/tmp/RtmpqFaq.1/UvRQNU/rep1/landscape_year2.rds"
  
  x[2]: "/tmp/RtmpqFaq.1/UvRQNU/rep1/caribou_year2"
  y[2]: "/tmp/RtmpqFaq.1/UvRQNU/rep1/caribou_year2.rds"
  
  ── 3. Failure: experiment does not work correctly (@test-experiment.R#62)  ─────
  outputs(sims[[x]])$file not equal to `%>%`(...).
  2/2 mismatches
  x[1]: "/tmp/RtmpqFaq.1/UvRQNU/rep2/landscape_year2"
  y[1]: "/tmp/RtmpqFaq.1/UvRQNU/rep2/landscape_year2.rds"
  
  x[2]: "/tmp/RtmpqFaq.1/UvRQNU/rep2/caribou_year2"
  y[2]: "/tmp/RtmpqFaq.1/UvRQNU/rep2/caribou_year2.rds"
  
  ── 4. Failure: experiment does not work correctly (@test-experiment.R#62)  ─────
  outputs(sims[[x]])$file not equal to `%>%`(...).
  2/2 mismatches
  x[1]: "/tmp/RtmpqFaq.1/UvRQNU/rep3/landscape_year2"
  y[1]: "/tmp/RtmpqFaq.1/UvRQNU/rep3/landscape_year2.rds"
  
  x[2]: "/tmp/RtmpqFaq.1/UvRQNU/rep3/caribou_year2"
  y[2]: "/tmp/RtmpqFaq.1/UvRQNU/rep3/caribou_year2.rds"
  
  ── 5. Error: experiment does not work correctly (@test-experiment.R#104)  ──────
  replacement has length zero
  1: experiment(mySimNoRL, replicates = 2, inputs = lapply(landscapeFiles, function(filenames) {
         data.frame(file = filenames, loadTime = 0, objectName = "landscape", stringsAsFactors = FALSE)
     })) at testthat/test-experiment.R:104
  2: experiment(mySimNoRL, replicates = 2, inputs = lapply(landscapeFiles, function(filenames) {
         data.frame(file = filenames, loadTime = 0, objectName = "landscape", stringsAsFactors = FALSE)
     }))
  3: do.call(get(parFun), args)
  4: (function (X, FUN, ...) 
     {
         FUN <- match.fun(FUN)
         if (!is.vector(X) || is.object(X)) 
             X <- as.list(X)
         .Internal(lapply(X, FUN))
     })(X = 1:4, FUN = function (ind, ...) 
     {
         mod <- strsplit(names(factorialExp), split = "\\.") %>% sapply(function(x) x[1])
         param <- strsplit(names(factorialExp), split = "\\.") %>% sapply(function(x) x[2])
         param[is.na(param)] <- ""
         paramValues <- factorialExp[ind, ]
         whNotExpLevel <- which(colnames(paramValues) != "expLevel")
         if (length(whNotExpLevel) < length(paramValues)) {
             mod <- mod[whNotExpLevel]
             param <- param[whNotExpLevel]
             paramValues <- paramValues[whNotExpLevel]
         }
         whNotRepl <- which(colnames(paramValues) != "replicate")
         if (length(whNotRepl) < length(paramValues)) {
             repl <- paramValues$replicate
             mod <- mod[whNotRepl]
             param <- param[whNotRepl]
             paramValues <- paramValues[whNotRepl]
         }
         notNA <- which(!is.na(paramValues))
         if (length(notNA) < length(mod)) {
             mod <- mod[notNA]
             param <- param[notNA]
             paramValues <- paramValues[notNA]
         }
         sim_ <- Copy(sim)
         experimentDF <- data.frame(module = character(0), param = character(0), val = I(list()), 
             modules = character(0), input = data.frame(), object = character(0), expLevel = numeric(0), 
             stringsAsFactors = FALSE)
         for (x in seq_along(mod)) {
             if (any(mod != "modules")) {
                 y <- factorialExp[ind, names(paramValues)[x]]
                 if (!is.na(y) & (mod[x] != "modules")) {
                     val <- params[[mod[x]]][[param[[x]]]][[y]]
                     params(sim_)[[mod[x]]][[param[[x]]]] <- val
                     experimentDF <- rbindlist(l = list(experimentDF, data.frame(module = if (!(mod[x] %in% 
                       c("input", "object"))) mod[x] else NA, param = if (!(mod[x] %in% 
                       c("input", "object"))) param[x] else NA, val = if (!(mod[x] %in% 
                       c("input", "object"))) I(list(val)) else list(NA), modules = paste0(unlist(modules[factorialExp[ind, 
                       "modules"]]), collapse = ","), input = if (mod[x] %in% c("input")) inputs[[factorialExp[ind, 
                       "input"]]] else NA, object = if (mod[x] %in% c("object")) names(objects)[[factorialExp[ind, 
                       "object"]]] else NA, expLevel = factorialExp[ind, "expLevel"], 
                       stringsAsFactors = FALSE)), use.names = TRUE, fill = TRUE)
                 }
             }
             else {
                 experimentDF <- rbindlist(l = list(experimentDF, data.frame(modules = paste0(unlist(modules[factorialExp[ind, 
                     "modules"]]), collapse = ","), expLevel = factorialExp[ind, "expLevel"], 
                     stringsAsFactors = FALSE)), use.names = TRUE, fill = TRUE)
             }
             if ("modules" %in% names(factorialExp)) {
                 if (!identical(sort(unlist(modules[factorialExp[ind, "modules"]])), sort(unlist(SpaDES.core::modules(sim))))) {
                     sim_ <- simInit(params = params(sim_), modules = as.list(unlist(modules[factorialExp[ind, 
                       "modules"]])), times = append(lapply(times(sim_)[2:3], as.numeric), 
                       times(sim_)[4]), paths = paths(sim_), outputs = outputs(sim_))
                 }
             }
         }
         if (any(dirPrefix == "simNum")) {
             exptNum <- paddedFloatToChar(factorialExp$expLevel[ind], ceiling(log10(numExpLevels + 
                 1)))
         }
         dirPrefixTmp <- paste0(dirPrefix, collapse = "")
         if ((numExpLevels > 1) & (substrLength > 0)) {
             dirName <- paste(collapse = "-", substr(mod, 1, substrLength), substr(param, 
                 1, substrLength), paramValues, sep = "_")
             dirName <- gsub(dirName, pattern = "__", replacement = "_")
             if (any(dirPrefix == "simNum")) {
                 dirPrefix <- gsub(dirPrefixTmp, pattern = "simNum", replacement = exptNum)
             }
             if (any(dirPrefix != "")) {
                 dirName <- paste(paste(dirPrefix, collapse = ""), dirName, sep = "_")
             }
         }
         else if (substrLength == 0) {
             if (any(dirPrefix != "")) {
                 simplePrefix <- if (any(dirPrefix == "simNum")) 
                     exptNum
                 else ""
                 dirName <- gsub(dirPrefixTmp, pattern = "simNum", replacement = simplePrefix)
             }
         }
         else {
             if (any(dirPrefix != "")) {
                 dirName <- gsub(dirPrefixTmp, pattern = "simNum", replacement = "")
             }
         }
         if (exists("repl", inherits = FALSE)) {
             nn <- paste0("rep", paddedFloatToChar(repl, ceiling(log10(length(replicates) + 
                 1))))
             dirName <- if (!is.null(dirName)) {
                 file.path(dirName, nn)
             }
             else {
                 file.path(nn)
             }
         }
         newOutputPath <- file.path(paths(sim_)$outputPath, dirName) %>% gsub(pattern = "/$", 
             replacement = "") %>% gsub(pattern = "//", replacement = "/")
         if (!dir.exists(newOutputPath)) 
             dir.create(newOutputPath, recursive = TRUE)
         paths(sim_)$outputPath <- newOutputPath
         if (NROW(outputs(sim_))) {
             outputs(sim_)$file <- file.path(newOutputPath, basename(outputs(sim_)$file))
         }
         if (length(inputs) > 0) {
             SpaDES.core::inputs(sim_) <- inputs[[factorialExp[ind, "input"]]]
         }
         if (length(objects) > 0) {
             replaceObjName <- strsplit(names(objects)[[factorialExp[ind, "object"]]], 
                 split = "\\.")[[1]][1]
             sim_[[replaceObjName]] <- objects[[factorialExp[ind, "object"]]]
         }
         dots <- list(...)
         if (is.null(dots$cache)) 
             dots$cache <- FALSE
         sim3 <- spades(sim_, replicate = ind, ...)
         return(list(sim3, experimentDF))
     }, notOlderThan = NULL)
  5: FUN(X[[i]], ...)
  6: SpaDES.core::`inputs<-`(`*tmp*`, value = inputs[[factorialExp[ind, "input"]]])
  7: SpaDES.core::`inputs<-`(`*tmp*`, value = inputs[[factorialExp[ind, "input"]]])
  8: .fillInputRows(value, start(sim))
  
  ── 6. Failure: saving files does not work correctly (@test-save.R#33)  ─────────
  file.exists(file.path(tmpdir, "caribou_month1.rds")) isn't true.
  
  ── 7. Failure: saving files does not work correctly (@test-save.R#37)  ─────────
  file.exists(file.path(tmpdir, "caribou_month3.rds")) isn't true.
  
  ── 8. Failure: saving files does not work correctly (@test-save.R#38)  ─────────
  file.exists(file.path(tmpdir, "caribou_month5.rds")) isn't true.
  
  ── 9. Failure: saving files does not work correctly (@test-save.R#56)  ─────────
  file.exists(file.path(tmpdir, "caribou_month7.rds")) isn't true.
  
  ── 10. Failure: saving files does not work correctly (@test-save.R#57)  ────────
  file.exists(file.path(tmpdir, "landscape_month7.rds")) isn't true.
  
  ── 11. Error: saving csv files does not work correctly (@test-save.R#86)  ──────
  invalid 'description' argument
  1: read.csv(dir(tmpdir, pattern = "year10.csv", full.name = TRUE)) at testthat/test-save.R:86
  2: read.table(file = file, header = header, sep = sep, quote = quote, dec = dec, fill = fill, 
         comment.char = comment.char, ...)
  3: file(file, "rt")
  
    Using cached copy of .inputObjects event in child6 module. Adding to memoised copy.
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 290 SKIPPED: 35 FAILED: 11
  1. Error: /tmp/RtmpUkaiKT/R.INSTALL5b2148f348c0/SpaDES.core/man/simList-accessors-inout.Rd 
  2. Failure: experiment does not work correctly (@test-experiment.R#62) 
  3. Failure: experiment does not work correctly (@test-experiment.R#62) 
  4. Failure: experiment does not work correctly (@test-experiment.R#62) 
  5. Error: experiment does not work correctly (@test-experiment.R#104) 
  6. Failure: saving files does not work correctly (@test-save.R#33) 
  7. Failure: saving files does not work correctly (@test-save.R#37) 
  8. Failure: saving files does not work correctly (@test-save.R#38) 
  9. Failure: saving files does not work correctly (@test-save.R#56) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted