RajLabMSSM / echodeps

echoverse module: Create package dependency graphs

Home Page:https://rajlabmssm.github.io/echodeps/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local checks on MacOS fail, despite functions running fine in R console

bschilder opened this issue · comments

─ Test failures ─────────────────────── testthat ────

> desc_path <- list.files("../","^DESCRIPTION$",
+                         full.names = TRUE, recursive = TRUE)[1]
> pkg <- read.dcf(desc_path, fields = "Package")[1]
> library(testthat)
> library(pkg, character.only = TRUE)
> 
> test_check(pkg)
Loading required namespace: pkgnet
Generating `pkgnet` package report.
INFO [2022-11-12 03:01:52] Creating package report for package echolocatoR with reporters: SummaryReporter, DependencyReporter, FunctionReporter
INFO [2022-11-12 03:01:53] Rendering package report...
INFO [2022-11-12 03:02:05] Done creating package report! It is available at /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//Rtmpv6Wp7q/working_dir/RtmpkJtSMV/echolocatoR8345953adf3.html
Constructing dependency subgraph.
Adding all echoverse modules to metadata search.
Collecting metadata for 13 packages
- echolocatoR
 ----------- FAILURE REPORT -------------- 
 --- failure: length > 1 in coercion to logical ---
 --- srcref --- 
: 
 --- package (from environment) --- 
echodeps
 --- call from context --- 
doTryCatch(return(expr), name, parentenv, handler)
 --- call from argument --- 
!methods::is(d, "data.frame") && is.na(d)
 --- R stacktrace ---
where 1: doTryCatch(return(expr), name, parentenv, handler)
where 2: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 3: tryCatchList(expr, classes, parentenv, handlers)
where 4: tryCatch({
    messager("-", pkg, v = verbose)
    d <- utils::packageDescription(pkg)
    if (!methods::is(d, "data.frame") && is.na(d)) {
        return(NULL)
    }
    data.table::data.table(t(`names<-`(lapply(fields, function(x) {
        if (is.null(d[[x]])) return(NA)
        parse_deps(d = d, field = x, split = if (x %in% c("Title", 
            "Description")) "______" else ",")
    }), fields)))
}, error = function(e) {
    warning(e)
    NULL
})
where 5: FUN(X[[i]], ...)
where 6: lapply(pkgs, function(pkg) {
    tryCatch({
        messager("-", pkg, v = verbose)
        d <- utils::packageDescription(pkg)
        if (!methods::is(d, "data.frame") && is.na(d)) {
            return(NULL)
        }
        data.table::data.table(t(`names<-`(lapply(fields, function(x) {
            if (is.null(d[[x]])) return(NA)
            parse_deps(d = d, field = x, split = if (x %in% c("Title", 
                "Description")) "______" else ",")
        }), fields)))
    }, error = function(e) {
        warning(e)
        NULL
    })
})
where 7: data.table::rbindlist(lapply(pkgs, function(pkg) {
    tryCatch({
        messager("-", pkg, v = verbose)
        d <- utils::packageDescription(pkg)
        if (!methods::is(d, "data.frame") && is.na(d)) {
            return(NULL)
        }
        data.table::data.table(t(`names<-`(lapply(fields, function(x) {
            if (is.null(d[[x]])) return(NA)
            parse_deps(d = d, field = x, split = if (x %in% c("Title", 
                "Description")) "______" else ",")
        }), fields)))
    }, error = function(e) {
        warning(e)
        NULL
    })
}))
where 8: package_metadata(pkgs = c(pkg_name, deps))
where 9: dep_graph_create(pkg_name = pkg_name, deps = deps, verbose = verbose)
where 10 at test-dep_graph.R#13: echodeps::dep_graph()
where 11: eval(code, test_env)
where 12: eval(code, test_env)
where 13: withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error)
where 14: doTryCatch(return(expr), name, parentenv, handler)
where 15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 16: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
where 17: doTryCatch(return(expr), name, parentenv, handler)
where 18: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
    names[nh], parentenv, handlers[[nh]])
where 19: tryCatchList(expr, classes, parentenv, handlers)
where 20: tryCatch(withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error), error = handle_fatal, 
    skip = function(e) {
    })
where 21: test_code(desc, code, env = parent.frame(), reporter = reporter)
where 22 at test-dep_graph.R#1: test_that("dep_graph works", {
    run_tests <- function(res, pkg_name) {
        testthat::expect_true(methods::is(res$plot, "visNetwork"))
        testthat::expect_true(methods::is(res$metadata, "data.frame"))
        testthat::expect_true(methods::is(res$graph, "igraph"))
        testthat::expect_true(methods::is(res$subgraph, "igraph"))
        testthat::expect_true(methods::is(res$pkgnet_report, 
            "PackageReport"))
        testthat::expect_equal(res$pkg_name, pkg_name)
    }
    res <- echodeps::dep_graph()
    run_tests(res = res, pkg_name = "echolocatoR")
    res2 <- echodeps::dep_graph(pkg_name = "dplyr", shape = "hexagon", 
        layout = function(graph, pkg_name) {
            visNetwork::visIgraphLayout(graph = graph, layout = "layout_nicely")
        })
    run_tests(res = res2, pkg_name = "dplyr")
})
where 23: eval(code, test_env)
where 24: eval(code, test_env)
where 25: withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error)
where 26: doTryCatch(return(expr), name, parentenv, handler)
where 27: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 28: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
where 29: doTryCatch(return(expr), name, parentenv, handler)
where 30: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
    names[nh], parentenv, handlers[[nh]])
where 31: tryCatchList(expr, classes, parentenv, handlers)
where 32: tryCatch(withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error), error = handle_fatal, 
    skip = function(e) {
    })
where 33: test_code(NULL, exprs, env)
where 34: source_file(path, child_env(env), wrap = wrap)
where 35: FUN(X[[i]], ...)
where 36: lapply(test_paths, test_one_file, env = env, wrap = wrap)
where 37: doTryCatch(return(expr), name, parentenv, handler)
where 38: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 39: tryCatchList(expr, classes, parentenv, handlers)
where 40: tryCatch(code, testthat_abort_reporter = function(cnd) {
    cat(conditionMessage(cnd), "\n")
    NULL
})
where 41: with_reporter(reporters$multi, lapply(test_paths, test_one_file, 
    env = env, wrap = wrap))
where 42: test_files_serial(test_dir = test_dir, test_package = test_package, 
    test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, 
    env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
    wrap = wrap, load_package = load_package)
where 43: test_files(test_dir = path, test_paths = test_paths, test_package = package, 
    reporter = reporter, load_helpers = load_helpers, env = env, 
    stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
    wrap = wrap, load_package = load_package, parallel = parallel)
where 44: test_dir("testthat", package = package, reporter = reporter, 
    ..., load_package = "installed")
where 45: test_check(pkg)

 --- value of length: 21 type: logical ---
                Package                    Type                   Title 
                  FALSE                   FALSE                   FALSE 
                Version               Authors@R             Description 
                  FALSE                   FALSE                   FALSE 
                License                     URL              BugReports 
                  FALSE                   FALSE                   FALSE 
               Encoding                 Depends               biocViews 
                  FALSE                   FALSE                   FALSE 
                Imports                Suggests                 Remotes 
                  FALSE                   FALSE                   FALSE 
            RoxygenNote         VignetteBuilder Config/testthat/edition 
                  FALSE                   FALSE                   FALSE 
                 Author              Maintainer                   Built 
                  FALSE                   FALSE                   FALSE 
 --- function from context --- 
function (expr, name, parentenv, handler) 
{
    .Internal(.addCondHands(name, list(handler), parentenv, environment(), 
        FALSE))
    expr
}
<bytecode: 0x7fcf6f074ab8>
<environment: 0x7fcf7c4c23a0>
 --- function search by body ---
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: length > 1 in coercion to logical

session info

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] echolocatoR_2.0.3 echodeps_0.99.2   dplyr_1.0.10      data.table_1.14.4

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3              rtracklayer_1.58.0          GGally_2.1.2               
  [4] R.methodsS3_1.8.2           tidyr_1.2.1                 echoLD_0.99.8              
  [7] ggplot2_3.4.0               bit64_4.0.5                 knitr_1.40                 
 [10] irlba_2.3.5.1               DelayedArray_0.24.0         R.utils_2.12.2             
 [13] rpart_4.1.19                AnnotationFilter_1.22.0     KEGGREST_1.38.0            
 [16] RCurl_1.98-1.9              generics_0.1.3              BiocGenerics_0.44.0        
 [19] GenomicFeatures_1.50.2      callr_3.7.3                 lambda.r_1.2.4             
 [22] usethis_2.1.6               RSQLite_2.2.18              proxy_0.4-27               
 [25] bit_4.0.4                   tzdb_0.3.0                  xml2_1.3.3                 
 [28] httpuv_1.6.6                SummarizedExperiment_1.28.0 assertthat_0.2.1           
 [31] viridis_0.6.2               xfun_0.34                   hms_1.1.2                  
 [34] jquerylib_0.1.4             evaluate_0.18               promises_1.2.0.1           
 [37] fansi_1.0.3                 restfulr_0.0.15             progress_1.2.2             
 [40] dbplyr_2.2.1                readxl_1.4.1                Rgraphviz_2.42.0           
 [43] igraph_1.3.5                DBI_1.1.3                   htmlwidgets_1.5.4          
 [46] futile.logger_1.4.3         reshape_0.8.9               downloadR_0.99.5           
 [49] stats4_4.2.1                purrr_0.3.5                 ellipsis_0.3.2             
 [52] crosstalk_1.2.0             ggnewscale_0.4.8            backports_1.4.1            
 [55] deldir_1.0-6                biomaRt_2.54.0              MatrixGenerics_1.10.0      
 [58] vctrs_0.5.0                 Biobase_2.58.0              ensembldb_2.22.0           
 [61] remotes_2.4.2               cachem_1.0.6                withr_2.5.0                
 [64] BSgenome_1.66.1             checkmate_2.1.0             GenomicAlignments_1.34.0   
 [67] prettyunits_1.1.1           cluster_2.1.4               ape_5.6-2                  
 [70] dir.expiry_1.6.0            lazyeval_0.2.2              crayon_1.5.2               
 [73] basilisk.utils_1.10.0       crul_1.3                    pkgconfig_2.0.3            
 [76] GenomeInfoDb_1.34.3         ProtGenerics_1.30.0         nlme_3.1-160               
 [79] pkgload_1.3.1               XGR_1.1.8                   pals_1.7                   
 [82] nnet_7.3-18                 gitcreds_0.1.2              devtools_2.4.5             
 [85] rlang_1.0.6                 lifecycle_1.0.3             miniUI_0.1.1.1             
 [88] filelock_1.0.2              httpcode_0.3.0              BiocFileCache_2.6.0        
 [91] rex_1.2.1                   dichromat_2.0-0.1           echotabix_0.99.8           
 [94] cellranger_1.1.0            coloc_5.1.0.1               rprojroot_2.0.3            
 [97] matrixStats_0.62.0          graph_1.76.0                Matrix_1.5-3               
[100] osfr_0.2.9                  boot_1.3-28                 base64enc_0.1-3            
[103] processx_3.8.0              png_0.1-7                   viridisLite_0.4.1          
[106] rjson_0.2.21                rootSolve_1.8.2.3           bitops_1.0-7               
[109] R.oo_1.25.0                 visNetwork_2.1.2            ggnetwork_0.5.10           
[112] Biostrings_2.66.0           blob_1.2.3                  mixsqp_0.3-43              
[115] stringr_1.4.1               echoplot_0.99.6             dnet_1.1.7                 
[118] jpeg_0.1-9                  readr_2.1.3                 S4Vectors_0.36.0           
[121] echodata_0.99.16            scales_1.2.1                memoise_2.0.1              
[124] magrittr_2.0.3              plyr_1.8.8                  hexbin_1.28.2              
[127] pkgnet_0.4.2                zlibbioc_1.44.0             compiler_4.2.1             
[130] echoconda_0.99.8            BiocIO_1.8.0                catalogueR_1.0.0           
[133] RColorBrewer_1.1-3          covr_3.6.1                  Rsamtools_2.14.0           
[136] cli_3.4.1                   XVector_0.38.0              echoannot_0.99.10          
[139] urlchecker_1.0.1            patchwork_1.1.2             ps_1.7.2                   
[142] htmlTable_2.4.1             Formula_1.2-4               formatR_1.12               
[145] MASS_7.3-58.1               tidyselect_1.2.0            stringi_1.7.8              
[148] yaml_2.3.6                  supraHex_1.36.0             latticeExtra_0.6-30        
[151] ggrepel_0.9.2               grid_4.2.1                  sass_0.4.2                 
[154] VariantAnnotation_1.44.0    tools_4.2.1                 lmom_2.9                   
[157] parallel_4.2.1              rstudioapi_0.14             foreign_0.8-83             
[160] piggyback_0.1.4             gridExtra_2.3               gld_2.6.6                  
[163] snpStats_1.48.0             digest_0.6.30               BiocManager_1.30.19        
[166] shiny_1.7.3                 Rcpp_1.0.9                  GenomicRanges_1.50.1       
[169] later_1.3.0                 OrganismDbi_1.40.0          httr_1.4.4                 
[172] AnnotationDbi_1.60.0        biovizBase_1.46.0           RCircos_1.2.2              
[175] ggbio_1.46.0                colorspace_2.0-3            brio_1.1.3                 
[178] XML_3.99-0.12               fs_1.5.2                    reticulate_1.26            
[181] splines_4.2.1               IRanges_2.32.0              RBGL_1.74.0                
[184] expm_0.999-6                gh_1.3.1                    echofinemap_0.99.4         
[187] basilisk_1.10.2             Exact_3.2                   mapproj_1.2.9              
[190] sessioninfo_1.2.2           xtable_1.8-4                jsonlite_1.8.3             
[193] futile.options_1.0.1        echogithub_0.99.0           testthat_3.1.5             
[196] susieR_0.12.27              R6_2.5.1                    Hmisc_4.7-1                
[199] profvis_0.3.7               pillar_1.8.1                htmltools_0.5.3            
[202] mime_0.12                   glue_1.6.2                  fastmap_1.1.0              
[205] DT_0.26                     BiocParallel_1.32.1         class_7.3-20               
[208] codetools_0.2-18            maps_3.4.1                  pkgbuild_1.3.1             
[211] mvtnorm_1.1-3               utf8_1.2.2                  lattice_0.20-45            
[214] bslib_0.4.1                 tibble_3.1.8                curl_4.3.3                 
[217] DescTools_0.99.47           interp_1.1-3                zip_2.2.2                  
[220] openxlsx_4.2.5.1            survival_3.4-0              roxygen2_7.2.2             
[223] rmarkdown_2.18              desc_1.4.2                  munsell_0.5.0              
[226] e1071_1.7-12                GenomeInfoDbData_1.2.9      reshape2_1.4.4             
[229] gtable_0.3.1 
``
</details>

This is due to testthat struggling to find DESCRIPTION files during testing. Commented out these tests for now.