zoonproject / zoon

The zoon R package
Other
61 stars 13 forks source link

Module travis not testing #338

Closed AugustT closed 8 years ago

AugustT commented 8 years ago

There are numerous modules that fail testing. These have been missed as the module testing has secretly stopped working on Travis (they will have failed the tests in BuildModule). Fix coming in PR (once I have fixed all the failing modules).

AugustT commented 8 years ago

Update

I have hit a number of issues in the process but one I'm struggling to overcome

A number of packages seem to refuse to install when GetPackage is called. This is an issue when checking devtools::check() but not in testing devtools::test()

Here is the sort of error I get on Travis

ERROR: dependency ‘KernSmooth’ is not available for package ‘gplots’
* removing ‘/tmp/RtmpdFNGJa/RLIBS_72391050bd62/gplots’
ERROR: dependency ‘gplots’ is not available for package ‘ROCR’
* removing ‘/tmp/RtmpdFNGJa/RLIBS_72391050bd62/ROCR’
ERROR: dependencies ‘ROCR’, ‘rpart’ are not available for package ‘sperrorest’
* removing ‘/tmp/RtmpdFNGJa/RLIBS_72391050bd62/sperrorest’

The downloaded source packages are in
    '/tmp/RtmpSc0Eq7/downloaded_packages'
7. Error: Check PROCESS output formats for PartitionDisc.R ---------------------
there is no package called 'sperrorest'
1: suppressWarnings({
       pro_return <- do.call(roxy_parse$name, args = list(.data = .data))
   })

While some other packages seem to install just fine. @goldingn can you try this on your linux box.

Installing these packages beforehand in the yml file does not solve the issue.

AugustT commented 8 years ago

Another approach is to re-write the yml file to only run the test script, which might be a better approach

AugustT commented 8 years ago

I'm beginning to think this might be an issue with the way GetPackage behaves in checks...

AugustT commented 8 years ago

I think it is as I suspected. I have added this test to the zoon package and it now fails on Travis

  rncep <- try(zoon::GetPackage('RNCEP'), silent = TRUE)
  expect_null(rncep, info = 'GetPackage has failed with "RNCEP"')

Can't figure out why though

timcdlucas commented 8 years ago

Is it only the packages that require external packages? On linux (guess mac is the same) you need gdal-lib-dev or whatever it is to install rgdal? GetPackage obviously doesn't deal with this.

AugustT commented 8 years ago

I don't think so it appears to affect a range of packages but let me double check. Note it fails locally on my machine too.

AugustT commented 8 years ago

I can confirm this same error occurs for lme4. It fails in devtools::check() but not devtools::test(). I wonder if it has something to do with libs or repos arguments to install.packages and if these are changed when running checks

goldingn commented 8 years ago

Aah the arcane inner workings of testthat. Still want me to test something on linux?

AugustT commented 8 years ago

I was lying on a picnic blanket in bordeaux yesterday, enjoying the 30c sunshine and decided I will just write a script that finds all the packages loaded with getpackage and add them to the namespace. We need the testing the work and this, thought inelegant, should do the job. I don't think there is a solution to the specific testthat issue. I suggest it is not tested.

goldingn commented 8 years ago

☀️ 🍷 😎 💻 👍