rdotnet/rClr

test failure: Time objects are marshalled correctly

wibeasley opened this issue · 5 comments

When installing the Windows executable

install.packages("K:/Downloads/rClr_0.7-4.zip", repos=NULL, type="win.binary")

I see the following test failures on two different machines (Win8 w/ R 3.2 and Win7 w/ R 3.1.3).

> testthat::test_package('rClr')
rClr essentials : ...............................................................................................................................................................................................
Date and times : ..............................................12.....................................................................................

1. Failure (@C:/Program Files/R/R-3.1.3patched/library/rClr/tests/datetime-functions.r#59): Date and Time objects are marshalled correctly 
From CLR : 2000-12-31 13:00:00 UTC;2001-01-01 13:00:00 UTC;2001-01-02 13:00:00 UTC;2001-01-03 13:00:00 UTC;2001-01-04 13:00:00 UTC not equal to Expected : 2001-01-01 06:00:00 UTC;2001-01-02 06:00:00 UTC;2001-01-03 06:00:00 UTC;2001-01-04 06:00:00 UTC;2001-01-05 06:00:00 UTC
Mean absolute difference: 61200

2. Failure (@C:/Program Files/R/R-3.1.3patched/library/rClr/tests/datetime-functions.r#59): Date and Time objects are marshalled correctly 
From CLR : 2000-12-31 13:00:00 UTC;2000-12-31 13:00:01 UTC;2000-12-31 13:00:02 UTC;2000-12-31 13:00:03 UTC;2000-12-31 13:00:04 UTC;2000-12-31 13:00:05 UTC;2000-12-31 13:00:06 UTC;2000-12-31 13:00:07 UTC;2000-12-31 13:00:08 UTC;2000-12-31 13:00:09 UTC;2000-12-31 13:00:10 UTC;2000-12-31 13:00:11 UTC;2000-12-31 13:00:12 UTC;2000-12-31 13:00:13 UTC;2000-12-31 13:00:14 UTC;2000-12-31 13:00:15 UTC;2000-12-31 13:00:16 UTC;2000-12-31 13:00:17 UTC;2000-12-31 13:00:18 UTC;2000-12-31 13:00:19 UTC;2000-12-31 13:00:20 UTC;2000-12-31 13:00:21 UTC;2000-12-31 13:00:22 UTC;2000-12-31 13:00:23 UTC;2000-12-31 13:00:24 UTC;2000-12-31 13:00:25 UTC;2000-12-31 13:00:26 UTC;2000-12-31 13:00:27 UTC;2000-12-31 13:00:28 UTC;2000-12-31 13:00:29 UTC;2000-12-31 13:00:30 UTC;2000-12-31 13:00:31 UTC;2000-12-31 13:00:32 UTC;2000-12-31 13:00:33 UTC;2000-12-31 13:00:34 UTC;2000-12-31 13:00:35 UTC;2000-12-31 13:00:36 UTC;2000-12-31 13:00:37 UTC;2000-12-31 13:00:38 UTC;2000-12-31 13:00:39 UTC;2000-12-31 13:00:40 UTC;2000-12-31 13:00:41 UTC not equal to Expected : 2001-01-01 06:00:00 UTC;2001-01-01 06:00:01 UTC;2001-01-01 06:00:02 UTC;2001-01-01 06:00:03 UTC;2001-01-01 06:00:04 UTC;2001-01-01 06:00:05 UTC;2001-01-01 06:00:06 UTC;2001-01-01 06:00:07 UTC;2001-01-01 06:00:08 UTC;2001-01-01 06:00:09 UTC;2001-01-01 06:00:10 UTC;2001-01-01 06:00:11 UTC;2001-01-01 06:00:12 UTC;2001-01-01 06:00:13 UTC;2001-01-01 06:00:14 UTC;2001-01-01 06:00:15 UTC;2001-01-01 06:00:16 UTC;2001-01-01 06:00:17 UTC;2001-01-01 06:00:18 UTC;2001-01-01 06:00:19 UTC;2001-01-01 06:00:20 UTC;2001-01-01 06:00:21 UTC;2001-01-01 06:00:22 UTC;2001-01-01 06:00:23 UTC;2001-01-01 06:00:24 UTC;2001-01-01 06:00:25 UTC;2001-01-01 06:00:26 UTC;2001-01-01 06:00:27 UTC;2001-01-01 06:00:28 UTC;2001-01-01 06:00:29 UTC;2001-01-01 06:00:30 UTC;2001-01-01 06:00:31 UTC;2001-01-01 06:00:32 UTC;2001-01-01 06:00:33 UTC;2001-01-01 06:00:34 UTC;2001-01-01 06:00:35 UTC;2001-01-01 06:00:36 UTC;2001-01-01 06:00:37 UTC;2001-01-01 06:00:38 UTC;2001-01-01 06:00:39 UTC;2001-01-01 06:00:40 UTC;2001-01-01 06:00:41 UTC
Mean absolute difference: 61200
Error: Test failures

Is there something I am doing wrong, or can do to help the development/troubleshooting?

jmp75 commented

Looks like the tests fail on testing the conversion of UTC dates. What is the time zone configuration of your computer? If you have also more of the call stack (possibly by getting the output of the test_package function?) this would help diagnose the issue.

I don't think the traceback from the test suite will help. But I'm not sure how do get better info when I install from the CodePlex binaries. Tell me if there's other diagnostic info I can provide.

> Sys.timezone()
[1] "America/Chicago"

> sessionInfo()
R version 3.2.1 Patched (2015-07-12 r68650)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] rClr_0.7-4           testthat_0.10.0.9000

loaded via a namespace (and not attached):
[1] tools_3.2.1   memoise_0.2.1 crayon_1.3.1  digest_0.6.8 

If you have also more of the call stack (possibly by getting the output of the test_package function?) this would help diagnose the issue.

This is the entire output from testthat::test_package('rClr'):

1. Failure (at D:/Projects/RLibraries/rClr/tests/datetime-functions.r#59): Date and Time objects are marshalled correctly 
From CLR : 2000-12-31 13:00:00 UTC;2001-01-01 13:00:00 UTC;2001-01-02 13:00:00 UTC;2001-01-03 13:00:00 UTC;2001-01-04 13:00:00 UTC not equal to Expected : 2001-01-01 06:00:00 UTC;2001-01-02 06:00:00 UTC;2001-01-03 06:00:00 UTC;2001-01-04 06:00:00 UTC;2001-01-05 06:00:00 UTC
Mean absolute difference: 61200

2. Failure (at D:/Projects/RLibraries/rClr/tests/datetime-functions.r#59): Date and Time objects are marshalled correctly 
From CLR : 2000-12-31 13:00:00 UTC;2000-12-31 13:00:01 UTC;2000-12-31 13:00:02 UTC;2000-12-31 13:00:03 UTC;2000-12-31 13:00:04 UTC;2000-12-31 13:00:05 UTC;2000-12-31 13:00:06 UTC;2000-12-31 13:00:07 UTC;2000-12-31 13:00:08 UTC;2000-12-31 13:00:09 UTC;2000-12-31 13:00:10 UTC;2000-12-31 13:00:11 UTC;2000-12-31 13:00:12 UTC;2000-12-31 13:00:13 UTC;2000-12-31 13:00:14 UTC;2000-12-31 13:00:15 UTC;2000-12-31 13:00:16 UTC;2000-12-31 13:00:17 UTC;2000-12-31 13:00:18 UTC;2000-12-31 13:00:19 UTC;2000-12-31 13:00:20 UTC;2000-12-31 13:00:21 UTC;2000-12-31 13:00:22 UTC;2000-12-31 13:00:23 UTC;2000-12-31 13:00:24 UTC;2000-12-31 13:00:25 UTC;2000-12-31 13:00:26 UTC;2000-12-31 13:00:27 UTC;2000-12-31 13:00:28 UTC;2000-12-31 13:00:29 UTC;2000-12-31 13:00:30 UTC;2000-12-31 13:00:31 UTC;2000-12-31 13:00:32 UTC;2000-12-31 13:00:33 UTC;2000-12-31 13:00:34 UTC;2000-12-31 13:00:35 UTC;2000-12-31 13:00:36 UTC;2000-12-31 13:00:37 UTC;2000-12-31 13:00:38 UTC;2000-12-31 13:00:39 UTC;2000-12-31 13:00:40 UTC;2000-12-31 13:00:41 UTC not equal to Expected : 2001-01-01 06:00:00 UTC;2001-01-01 06:00:01 UTC;2001-01-01 06:00:02 UTC;2001-01-01 06:00:03 UTC;2001-01-01 06:00:04 UTC;2001-01-01 06:00:05 UTC;2001-01-01 06:00:06 UTC;2001-01-01 06:00:07 UTC;2001-01-01 06:00:08 UTC;2001-01-01 06:00:09 UTC;2001-01-01 06:00:10 UTC;2001-01-01 06:00:11 UTC;2001-01-01 06:00:12 UTC;2001-01-01 06:00:13 UTC;2001-01-01 06:00:14 UTC;2001-01-01 06:00:15 UTC;2001-01-01 06:00:16 UTC;2001-01-01 06:00:17 UTC;2001-01-01 06:00:18 UTC;2001-01-01 06:00:19 UTC;2001-01-01 06:00:20 UTC;2001-01-01 06:00:21 UTC;2001-01-01 06:00:22 UTC;2001-01-01 06:00:23 UTC;2001-01-01 06:00:24 UTC;2001-01-01 06:00:25 UTC;2001-01-01 06:00:26 UTC;2001-01-01 06:00:27 UTC;2001-01-01 06:00:28 UTC;2001-01-01 06:00:29 UTC;2001-01-01 06:00:30 UTC;2001-01-01 06:00:31 UTC;2001-01-01 06:00:32 UTC;2001-01-01 06:00:33 UTC;2001-01-01 06:00:34 UTC;2001-01-01 06:00:35 UTC;2001-01-01 06:00:36 UTC;2001-01-01 06:00:37 UTC;2001-01-01 06:00:38 UTC;2001-01-01 06:00:39 UTC;2001-01-01 06:00:40 UTC;2001-01-01 06:00:41 UTC
Mean absolute difference: 61200
Error: Test failures

The post above is from the the 0.7.4 CodePlex binaries.

In order to help diagnose the marshaling/date issue, tell me if I need to install the latest version from GitHub (which I had trouble doing). Here's that output. I don't have the Mono SDK. Is that the source of the problem, or just a warning that doesn't matter since I have .NET installed?

> remove.packages('rClr')
Removing package fromD:/Projects/RLibraries’
(aslibis unspecified)

Restarting R session...

pure virtual method called
> library(devtools)
> install_github("jmp75/rClr", build_vignettes=TRUE)
Downloading github repo jmp75/rClr@master
Installing rClr
Skipping 1 packages ahead of CRAN: testthat
"C:/PROGRA~1/R/R-32~1.1PA/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD  \
  build  \
  "C:\Users\Will\AppData\Local\Temp\RtmpasI8dc\devtools30f47f296ed9\jmp75-rClr-016a924"  \
  --no-resave-data --no-manual 

* checking for file 'C:\Users\Will\AppData\Local\Temp\RtmpasI8dc\devtools30f47f296ed9\jmp75-rClr-016a924/DESCRIPTION' ... OK
* preparing 'rClr':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* running 'cleanup.win'
* installing the package to build vignettes
Warning: running command '"C:/PROGRA~1/R/R-32~1.1PA/bin/x64/Rcmd.exe" INSTALL -l "C:\Users\Will\AppData\Local\Temp\Rtmp4coWXl\Rinst2cdc78e35098" --no-multiarch "C:/Users/Will/AppData/Local/Temp/Rtmp4coWXl/Rbuild2cdc7fe67e9f/rClr"' had status 1
      -----------------------------------
* installing *source* package 'rClr' ...
warning: Path to the Mono SDK not found by querying the Windows registry. Mono support will be disabled
R_HOME=C:/PROGRA~1/R/R-32~1.1PA
'VSCOMNTOOLS' is not recognized as an internal or external command,
operable program or batch file.
ERROR: setup_vcpp cannot determine the location of the VS Common Tools folder.
'lib' is not recognized as an internal or external command,
operable program or batch file.
'lib' is not recognized as an internal or external command,
operable program or batch file.
'lib' is not recognized as an internal or external command,
operable program or batch file.
Warning: running command 'sh ./configure.win' had status 1
ERROR: configuration failed for package 'rClr'
* removing 'C:/Users/Will/AppData/Local/Temp/Rtmp4coWXl/Rinst2cdc78e35098/rClr'
      -----------------------------------
ERROR: package installation failed
Error: Command failed (1)
jmp75 commented

One test was machine dependent: creating an R POSIXct in local time of the machine, but testing round trip to .NET expected the test date to have been created as a Canberra time zine. I don;t think the intent was correct. Fixed in 0.7-8

I was just brave enough to install from GitHub instead of the binaries (b/c Code Plex still has 7.4). The tests worked well. Thank you.