Skip to content

test failures #134

@achubaty

Description

@achubaty
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-00pkgSnapshot_testthat.R:23:5'): test 1 ────────────────────────
Error in `(function (desc_path, which = c("Depends", "Imports", "LinkingTo"), 
    keepVersionNumber = TRUE, purge = getOption("Require.purge", 
        FALSE), keepSeparate = FALSE) 
{
    if (is.null(pkgDepEnv())) {
        envPkgDepCreate()
    }
    if (is.null(envPkgDepDESCFile())) {
        envPkgDepDESCFileCreate()
    }
    objName <- if (length(desc_path) == 1) {
        paste0(desc_path, paste0(collapse = "_", which, "_", 
            keepVersionNumber))
    }
    else {
        grepPackage <- "Package *: *"
        grepVersion <- "Version *: *"
        suppressWarnings({
            pkg <- gsub(grepPackage, "", grep(grepPackage, desc_path, 
                value = TRUE))
        })
        suppressWarnings({
            vers <- gsub(grepVersion, "", grep(grepVersion, desc_path, 
                value = TRUE))
        })
        paste(pkg, vers, sep = "_", paste0(which, "_", keepVersionNumber, 
            collapse = "_"))
    }
    if (isTRUE(length(objName) > 1) || isTRUE(any(!exists(objName, 
        envir = envPkgDepDESCFile()))) || isTRUE(purge)) {
        if (is.null(desc_path)) {
            needed <- NULL
        }
        else {
            lines <- if (length(desc_path) == 1) {
                try(readLines(desc_path), silent = TRUE)
            }
            else {
                lines <- desc_path
            }
            if (is(lines, "try-error")) {
                stop("Cannot read the file: ", desc_path)
            }
            Sys.setlocale(locale = "C")
            on.exit(Sys.setlocale(locale = ""))
            sl <- list()
            sl[["Depends"]] <- grep("^Depends: *", lines)
            sl[["Suggests"]] <- grep("^Suggests: *", lines)
            sl[["Imports"]] <- grep("^Imports: *", lines)
            sl[["Linkingto"]] <- grep("^LinkingTo: *", lines)
            sl[["Remotes"]] <- grep("^Remotes: *", lines)
            sl[["colon"]] <- grep(": *", lines)
            which <- paste0(toupper(substr(which, 1, 1)), substr(which, 
                2, 10000))
            which <- unique(which)
            whichLower <- tolower(which)
            needed <- Map(wh = which, function(wh) {
                if (length(sl[[wh]])) {
                  whEnd <- which(sl[["colon"]] %in% sl[[wh]]) + 
                    1
                  whEnd <- if (length(sl[["colon"]]) < whEnd) {
                    length(lines)
                  }
                  else {
                    (sl[["colon"]][whEnd] - 1)
                  }
                  allLines <- sl[[wh]]:whEnd
                  needs <- paste(lines[allLines], collapse = "")
                  needs <- gsub(paste0(wh, ": *"), "", needs)
                  needs <- strsplit(needs, split = ", *")
                  needs <- gsub(" *$", "", needs[[1]])
                  if (isFALSE(keepVersionNumber)) {
                    needs <- trimVersionNumber(needs)
                  }
                  needs
                }
            })
            if (length(objName) == 1) {
                assign(objName, needed, envir = envPkgDepDESCFile())
            }
        }
    }
    else {
        needed <- get(objName, envir = envPkgDepDESCFile())
    }
    if (!keepSeparate) {
        needed <- unname(unlist(needed))
        needed <- grep("^R[\\( ]", needed, value = TRUE, invert = TRUE)
    }
    needed
})(desc_path = dots[[1L]][[1L]], which = c("Depends", "Imports", 
"LinkingTo", "Suggests"), keepSeparate = TRUE)`: Cannot read the file: NA
Backtrace:1. ├─testthat::capture_warnings(...) at test-00pkgSnapshot_testthat.R:23:5
 2. │ └─base::withCallingHandlers(...)
 3. └─Require::Require(...)
 4.   └─Require:::doInstalls(...)
 5.     └─Require:::doDownloads(...)
 6.       └─base (local) DESCRIPTIONFileDepsV(rr, which = colsHere, keepSeparate = TRUE)
 7.         ├─base::do.call(...)
 8.         └─base::mapply(...)
 9.           └─Require (local) `<fn>`(desc_path = dots[[1L]][[1L]], which = `<chr>`, keepSeparate = TRUE)
── Error ('test-01packages_testthat.R:86:5'): test 1 ───────────────────────────
Error in `(function (desc_path, which = c("Depends", "Imports", "LinkingTo"), 
    keepVersionNumber = TRUE, purge = getOption("Require.purge", 
        FALSE), keepSeparate = FALSE) 
{
    if (is.null(pkgDepEnv())) {
        envPkgDepCreate()
    }
    if (is.null(envPkgDepDESCFile())) {
        envPkgDepDESCFileCreate()
    }
    objName <- if (length(desc_path) == 1) {
        paste0(desc_path, paste0(collapse = "_", which, "_", 
            keepVersionNumber))
    }
    else {
        grepPackage <- "Package *: *"
        grepVersion <- "Version *: *"
        suppressWarnings({
            pkg <- gsub(grepPackage, "", grep(grepPackage, desc_path, 
                value = TRUE))
        })
        suppressWarnings({
            vers <- gsub(grepVersion, "", grep(grepVersion, desc_path, 
                value = TRUE))
        })
        paste(pkg, vers, sep = "_", paste0(which, "_", keepVersionNumber, 
            collapse = "_"))
    }
    if (isTRUE(length(objName) > 1) || isTRUE(any(!exists(objName, 
        envir = envPkgDepDESCFile()))) || isTRUE(purge)) {
        if (is.null(desc_path)) {
            needed <- NULL
        }
        else {
            lines <- if (length(desc_path) == 1) {
                try(readLines(desc_path), silent = TRUE)
            }
            else {
                lines <- desc_path
            }
            if (is(lines, "try-error")) {
                stop("Cannot read the file: ", desc_path)
            }
            Sys.setlocale(locale = "C")
            on.exit(Sys.setlocale(locale = ""))
            sl <- list()
            sl[["Depends"]] <- grep("^Depends: *", lines)
            sl[["Suggests"]] <- grep("^Suggests: *", lines)
            sl[["Imports"]] <- grep("^Imports: *", lines)
            sl[["Linkingto"]] <- grep("^LinkingTo: *", lines)
            sl[["Remotes"]] <- grep("^Remotes: *", lines)
            sl[["colon"]] <- grep(": *", lines)
            which <- paste0(toupper(substr(which, 1, 1)), substr(which, 
                2, 10000))
            which <- unique(which)
            whichLower <- tolower(which)
            needed <- Map(wh = which, function(wh) {
                if (length(sl[[wh]])) {
                  whEnd <- which(sl[["colon"]] %in% sl[[wh]]) + 
                    1
                  whEnd <- if (length(sl[["colon"]]) < whEnd) {
                    length(lines)
                  }
                  else {
                    (sl[["colon"]][whEnd] - 1)
                  }
                  allLines <- sl[[wh]]:whEnd
                  needs <- paste(lines[allLines], collapse = "")
                  needs <- gsub(paste0(wh, ": *"), "", needs)
                  needs <- strsplit(needs, split = ", *")
                  needs <- gsub(" *$", "", needs[[1]])
                  if (isFALSE(keepVersionNumber)) {
                    needs <- trimVersionNumber(needs)
                  }
                  needs
                }
            })
            if (length(objName) == 1) {
                assign(objName, needed, envir = envPkgDepDESCFile())
            }
        }
    }
    else {
        needed <- get(objName, envir = envPkgDepDESCFile())
    }
    if (!keepSeparate) {
        needed <- unname(unlist(needed))
        needed <- grep("^R[\\( ]", needed, value = TRUE, invert = TRUE)
    }
    needed
})(desc_path = dots[[1L]][[1L]], which = c("Depends", "Imports", 
"LinkingTo", "Suggests"), keepSeparate = TRUE)`: Cannot read the file: NA
Backtrace:1. ├─testthat::capture_warnings(...) at test-01packages_testthat.R:86:5
  2. │ └─base::withCallingHandlers(...)
  3. └─Require::Install(...)
  4.   └─Require::Require(...)
  5.     └─Require:::doInstalls(...)
  6.       └─Require:::doDownloads(...)
  7.         └─base (local) DESCRIPTIONFileDepsV(rr, which = colsHere, keepSeparate = TRUE)
  8.           ├─base::do.call(...)
  9.           └─base::mapply(...)
 10.             └─Require (local) `<fn>`(desc_path = dots[[1L]][[1L]], which = `<chr>`, keepSeparate = TRUE)

[ FAIL 2 | WARN 0 | SKIP 7 | PASS 78 ]
Error: Error: Test failures

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions