nat icon indicating copy to clipboard operation
nat copied to clipboard

cran check error with ndigest

Open jefferis opened this issue 5 years ago • 4 comments

I am not exactly sure of the origin of this error, but the digest value for a particular neuron is now changed on r-devel

  • unfortunately there seem to be some situations that cause digest differences but they are almost impossible to debug on CRAN
  • digest::sha1 does attempt to create a 32/64 bit stable hash, but even there are differences across package versions

The exact issue seems to be here: https://github.com/natverse/nat/blob/5f1774cbdb9728ed6a1d4e4d8c7a01a22519dd7b/tests/testthat/test-ndigest.R#L12-L13

jefferis avatar Aug 22 '19 09:08 jefferis

Here is the CRAN error

Version: 1.8.11 
Check: tests 
Result: ERROR 
     Running 'test-all.R' [31s/36s]
    Running the tests in 'tests/test-all.R' failed.
    Complete output:
     > library(testthat)
     > library(nat)
     Loading required package: rgl
     Registered S3 method overwritten by 'nat':
     method from
     as.mesh3d.ashape3d rgl 
     Some nat functions depend on a CMTK installation. See ?cmtk and README.md for details.
     
     Attaching package: 'nat'
     
     The following objects are masked from 'package:base':
     
     intersect, setdiff, union
     
     > library(httr)
     > 
     > # suppress RGL in headless environments (some CRAN build machines fail otherwise)
     > if(!interactive())
     + Sys.setenv(RGL_USE_NULL=TRUE)
     > 
     > # Is internet accessible?
     > internet.ok = identical(
     + try(
     + status_code(
     + HEAD("http://flybrain.mrc-lmb.cam.ac.uk/", timeout(2))
     + ),
     + silent = TRUE
     + ),
     + 200L
     + )
     > 
     > if(Sys.getenv('NOT_CRAN') == "true" && internet.ok) {
     + # note that we want to run all tests requiring internet access
     + Sys.setenv(NAT_INTERNET_TESTS="TRUE")
     + # Run all test files
     + test_check("nat")
     + } else {
     + # We're on CRAN or flybrain is inacessible, so don't run anything involving 
     + # remote files
     + Sys.setenv(NAT_INTERNET_TESTS="")
     + test_check("nat", filter="^[^.]+")
     + }
     -- 1. Failure: ndigest works for overloaded and regular classes (@test-ndigest.R
     ndigest(read.neuron("testdata/neuron/EBT7R.am")) not equal to "f24c1252d17b6bd9898c7842f1ad9f5d".
     1/1 mismatches
     x[1]: "a84b2255bb21e35d7906c756e7d14e47"
     y[1]: "f24c1252d17b6bd9898c7842f1ad9f5d"
     
     adding: testdata/neuron/testneuron_am3d.am (deflated 45%)
     adding: testdata/neuron/testneuron_lineset.am (deflated 69%)
     adding: DA1/EBH11R.swc (deflated 53%)
     adding: DA1/EBH20R.swc (deflated 54%)
     adding: DA1/EBI12L.swc (deflated 54%)
     adding: DL3/EBH20L.swc (deflated 54%)
     adding: DL3/EBI22R.swc (deflated 53%)
     == testthat results ===========================================================
     [ OK: 793 | SKIPPED: 4 | WARNINGS: 0 | FAILED: 1 ]
     1. Failure: ndigest works for overloaded and regular classes (@test-ndigest.R#12) 

jefferis avatar Aug 22 '19 09:08 jefferis

And the CRAN check status

image

jefferis avatar Aug 22 '19 09:08 jefferis

Worked around by 69d3f2c736c3f42c1575bf0a459911e947ddf8d3 which simply skips test on CRAN.

jefferis avatar Aug 22 '19 09:08 jefferis

Note that the windows and mac errors/warning are rgl related. So the digest mismatch is apparently due to a change in r-devel / r-patched.

jefferis avatar Aug 24 '19 08:08 jefferis