r-lib / rcmdcheck

Run R CMD check from R and collect the results
https://rcmdcheck.r-lib.org
Other
115 stars 27 forks source link

`compare_checks` always returns OK on R devel #193

Open vspinu opened 2 years ago

vspinu commented 2 years ago

All my revdepchecks on R devel were Ok, even though there were new errors in several packages. I have tracked it down to as.data.frame.rcmdcheck returning an empty data frame in rcmdcheck_comparison.

The problem is with rversion which is an empty list(). I think the expectaion is that it should be NULL not an empty list. This happens on R devel, but not in R stable.

All packages involved are dev version. R devel (unstable) (2022-10-19 r83129).

> oldnew <- dget("old-new.txt")
> str(oldnew$new)
List of 19
 $ stdout     : chr "* using log directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/gwasrapidd/new/gwasrapidd.Rcheck’\n* us"| __truncated__
 $ stderr     : chr ""
 $ status     : int 1
 $ duration   : num 47.7
 $ timeout    : logi FALSE
 $ rversion   : list()
 $ platform   : chr "x86_64-pc-linux-gnu"
 $ errors     : chr [1:2] "checking examples ... ERROR\nRunning examples in ‘gwasrapidd-Ex.R’ failed\nThe error most likely occurred in:\n"| __truncated__ "checking tests ...\n  Running ‘spelling.R’\n  Running ‘testthat.R’\n ERROR\nRunning the tests in ‘tests/testtha"| __truncated__
 $ warnings   : chr(0) 
 $ notes      : chr(0) 
 $ description: chr "Package: gwasrapidd\nType: Package\nTitle: 'REST' 'API' Client for the 'NHGRI'-'EBI' 'GWAS' Catalog\nVersion: 0"| __truncated__
 $ package    : chr "gwasrapidd"
 $ version    : chr "0.99.13"
 $ cran       : logi TRUE
 $ bioc       : logi TRUE
 $ checkdir   : chr "/home/vspinu/Dropbox/dev/lubridate/revdep/checks/gwasrapidd/new/gwasrapidd.Rcheck"
 $ test_fail  :List of 1
  ..$ testthat: chr "> library(testthat)\n> library(gwasrapidd)\n> \n> test_check(\"gwasrapidd\")\n[ FAIL 43 | WARN 2 | SKIP 1 | PAS"| __truncated__
 $ test_output:List of 1
  ..$ spelling: chr "> if(requireNamespace('spelling', quietly=TRUE))\n+   spelling::spell_check_test(vignettes = TRUE, error = FALS"| __truncated__
 $ install_out: chr "* installing *source* package ‘gwasrapidd’ ...\n** package ‘gwasrapidd’ successfully unpacked and MD5 sums chec"| __truncated__
 - attr(*, "class")= chr "rcmdcheck"
> as.data.frame(oldnew$new, which = "new")
[1] which    platform package  version  type     output   hash    
<0 rows> (or 0-length row.names)
> 
> oldnew$new$rversion <- "xx"
> as.data.frame(oldnew$new, which = "new")
  which            platform rversion    package version  type
1   new x86_64-pc-linux-gnu       xx gwasrapidd 0.99.13 error
2   new x86_64-pc-linux-gnu       xx gwasrapidd 0.99.13 error
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     output
1                                                                                                                                                                checking examples ... ERROR\nRunning examples in ‘gwasrapidd-Ex.R’ failed\nThe error most likely occurred in:\n\n> ### Name: get_variants\n> ### Title: Get GWAS Catalog variants\n> ### Aliases: get_variants\n> \n> ### ** Examples\n> \n> # Get variants by study identifier\n> get_variants(study_id = 'GCST001085', warnings = FALSE)\nError in if (is.numeric(x) && any(x > 1900)) { : \n  missing value where TRUE/FALSE needed\nCalls: get_variants ... <Anonymous> -> .parse_xxx_hms -> unlist -> lapply -> FUN\nExecution halted
2 checking tests ...\n  Running ‘spelling.R’\n  Running ‘testthat.R’\n ERROR\nRunning the tests in ‘tests/testthat.R’ failed.\nLast 13 lines of output:\n  } else {\n      as.character(x)\n  }`: missing value where TRUE/FALSE needed\n  Backtrace:\n      ▆\n   1. └─gwasrapidd:::empty_to_na(empty_date) at test-utils.R:38:2\n   2.   └─lubridate::ymd_hms(NA_real_)\n   3.     └─lubridate:::.parse_xxx_hms(...)\n   4.       ├─base::unlist(lapply(list(...), .num_to_date), use.names = FALSE)\n   5.       └─base::lapply(list(...), .num_to_date)\n   6.         └─lubridate (local) FUN(X[[i]], ...)\n  \n  [ FAIL 43 | WARN 2 | SKIP 1 | PASS 642 ]\n  Error: Test failures\n  Execution halted
                              hash
1 ade6d4b9f98a6eb27d5b3726e433fb12
2 81f642311a79a6f2aa2899b9dd6774af

old-new.txt