Skip to content

TZ=UTC causes spatsoc tests to fail with data.table 1.13.0 #32

@mattdowle

Description

@mattdowle

Hi Alec,

data.table v1.13.0 has just been published on CRAN. spatsoc is impacted just when TZ=UTC, e.g. "TZ=UTC R CMD check spatsoc_1.0.0.tar.gz". spatsoc is still passing on CRAN, and it didn't come up in CRAN's pre-release revdep testing. I think it's because none of the CRAN check machines sets TZ=UTC. I set TZ=UTC in my local revdep testing which is how I detected it.

It's due to the potentially breaking change in this release, that fread now reads UTC-datetime as POSIXct directly. See note 1 in NEWS here: https://github.com/Rdatatable/data.table/blob/master/NEWS.md. I'm not sure why exactly test-time.R is failing but it will be due to the fread() call at the top reading unmarked datetime as UTC-POSIXct directly (when user sets TZ=UTC) and then the expected error doesn't occur later that you're testing for.

I'm not sure it's necessary to make any change to spatsoc, since it's passing on CRAN. But if you do want to change it to survive TZ=UTC, the easiest way may be to pass tz="UTC" to the fread call (a new argument in this release), to always read unmarked datetime in UTC, and then proceed accordingly. Since local time in the csv is ambiguous anyway and could have come from any timezone.

Sorry for the extra work this change may cause you.

Best, Matt

TZ=UTC R CMD check spatsoc_0.1.14.tar.gz

./spatsoc.Rcheck/00check.log:* using log directory ‘/home/mdowle/build/revdeplib/spatsoc.Rcheck’
./spatsoc.Rcheck/00check.log:* using R Under development (unstable) (2020-07-14 r78854)
./spatsoc.Rcheck/00check.log:* using platform: x86_64-pc-linux-gnu (64-bit)
./spatsoc.Rcheck/00check.log:* using session charset: UTF-8
./spatsoc.Rcheck/00check.log:* checking for file ‘spatsoc/DESCRIPTION’ ... OK
./spatsoc.Rcheck/00check.log:* this is package ‘spatsoc’ version ‘0.1.14’
./spatsoc.Rcheck/00check.log:* package encoding: UTF-8
./spatsoc.Rcheck/00check.log:* checking package namespace information ... OK
./spatsoc.Rcheck/00check.log:* checking package dependencies ... OK
./spatsoc.Rcheck/00check.log:* checking if this is a source package ... OK
./spatsoc.Rcheck/00check.log:* checking if there is a namespace ... OK
./spatsoc.Rcheck/00check.log:* checking for executable files ... OK
./spatsoc.Rcheck/00check.log:* checking for hidden files and directories ... OK
./spatsoc.Rcheck/00check.log:* checking for portable file names ... OK
./spatsoc.Rcheck/00check.log:* checking for sufficient/correct file permissions ... OK
./spatsoc.Rcheck/00check.log:* checking whether package ‘spatsoc’ can be installed ... OK
./spatsoc.Rcheck/00check.log:* checking installed package size ... OK
./spatsoc.Rcheck/00check.log:* checking package directory ... OK
./spatsoc.Rcheck/00check.log:* checking ‘build’ directory ... OK
./spatsoc.Rcheck/00check.log:* checking DESCRIPTION meta-information ... OK
./spatsoc.Rcheck/00check.log:* checking top-level files ... OK
./spatsoc.Rcheck/00check.log:* checking for left-over files ... OK
./spatsoc.Rcheck/00check.log:* checking index information ... OK
./spatsoc.Rcheck/00check.log:* checking package subdirectories ... OK
./spatsoc.Rcheck/00check.log:* checking R files for non-ASCII characters ... OK
./spatsoc.Rcheck/00check.log:* checking R files for syntax errors ... OK
./spatsoc.Rcheck/00check.log:* checking whether the package can be loaded ... OK
./spatsoc.Rcheck/00check.log:* checking whether the package can be loaded with stated dependencies ... OK
./spatsoc.Rcheck/00check.log:* checking whether the package can be unloaded cleanly ... OK
./spatsoc.Rcheck/00check.log:* checking whether the namespace can be loaded with stated dependencies ... OK
./spatsoc.Rcheck/00check.log:* checking whether the namespace can be unloaded cleanly ... OK
./spatsoc.Rcheck/00check.log:* checking loading without being on the library search path ... OK
./spatsoc.Rcheck/00check.log:* checking dependencies in R code ... OK
./spatsoc.Rcheck/00check.log:* checking S3 generic/method consistency ... OK
./spatsoc.Rcheck/00check.log:* checking replacement functions ... OK
./spatsoc.Rcheck/00check.log:* checking foreign function calls ... OK
./spatsoc.Rcheck/00check.log:* checking R code for possible problems ... OK
./spatsoc.Rcheck/00check.log:* checking Rd files ... OK
./spatsoc.Rcheck/00check.log:* checking Rd metadata ... OK
./spatsoc.Rcheck/00check.log:* checking Rd cross-references ... OK
./spatsoc.Rcheck/00check.log:* checking for missing documentation entries ... OK
./spatsoc.Rcheck/00check.log:* checking for code/documentation mismatches ... OK
./spatsoc.Rcheck/00check.log:* checking Rd \usage sections ... OK
./spatsoc.Rcheck/00check.log:* checking Rd contents ... OK
./spatsoc.Rcheck/00check.log:* checking for unstated dependencies in examples ... OK
./spatsoc.Rcheck/00check.log:* checking installed files from ‘inst/doc’ ... OK
./spatsoc.Rcheck/00check.log:* checking files in ‘vignettes’ ... OK
./spatsoc.Rcheck/00check.log:* checking examples ... OK
./spatsoc.Rcheck/00check.log:* checking for unstated dependencies in ‘tests’ ... OK
./spatsoc.Rcheck/00check.log:* checking tests ... ERROR
./spatsoc.Rcheck/00check.log:  Running ‘testthat.R’
./spatsoc.Rcheck/00check.log:Running the tests in ‘tests/testthat.R’ failed.
./spatsoc.Rcheck/00check.log:Complete output:
./spatsoc.Rcheck/00check.log:  > library(testthat)
./spatsoc.Rcheck/00check.log:  > library(spatsoc)
./spatsoc.Rcheck/00check.log:  > 
./spatsoc.Rcheck/00check.log:  > test_check("spatsoc")
./spatsoc.Rcheck/00check.log:  ── 1. Failure: time field is appropriate format (@test-time.R#54)  ─────────────
./spatsoc.Rcheck/00check.log:  `group_times(copyDT, datetime = "datetime", threshold = "60 minutes")` did not throw an error.
./spatsoc.Rcheck/00check.log:  
./spatsoc.Rcheck/00check.log:  ══ testthat results  ═══════════════════════════════════════════════════════════
./spatsoc.Rcheck/00check.log:  [ OK: 266 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 1 ]
./spatsoc.Rcheck/00check.log:  1. Failure: time field is appropriate format (@test-time.R#54) 
./spatsoc.Rcheck/00check.log:  
./spatsoc.Rcheck/00check.log:  Error: testthat unit tests failed
./spatsoc.Rcheck/00check.log:  Execution halted
./spatsoc.Rcheck/00check.log:* checking for unstated dependencies in vignettes ... OK
./spatsoc.Rcheck/00check.log:* checking package vignettes in ‘inst/doc’ ... OK
./spatsoc.Rcheck/00check.log:* checking running R code from vignettes ... NONE
./spatsoc.Rcheck/00check.log:  ‘using-edge-and-dyad.Rmd’ using ‘UTF-8’... OK
./spatsoc.Rcheck/00check.log:  ‘faq.Rmd’ using ‘UTF-8’... OK
./spatsoc.Rcheck/00check.log:  ‘intro-spatsoc.Rmd’ using ‘UTF-8’... OK
./spatsoc.Rcheck/00check.log:  ‘using-in-sna.Rmd’ using ‘UTF-8’... OK
./spatsoc.Rcheck/00check.log:* checking re-building of vignette outputs ... OK
./spatsoc.Rcheck/00check.log:* checking PDF version of manual ... OK
./spatsoc.Rcheck/00check.log:* DONE
./spatsoc.Rcheck/00check.log:Status: 1 ERROR

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