Closed sckott closed 2 years ago
I believe this is just a matter of switching out:
rappdirs::user_cache_dir("rnoaa")
with
tools::R_user_dir("rnoaa", which = "cache")
Fixed it with #0ba86af. Ran tests and build checks. Merging into master and will do final checks before releasing to cran (and updating version as appropriate).
ππ½
Success, update now on CRAN
Unfortunately the fix apparently was not successful/sufficient. This is from Brian Ripley:
See the message below to the then maintainer of 'rnoaa'. rnoaa has a new version and maintainer but still writes in the prohibited area. It is now scheduled for archival on Nov 30. That will necessitate archiving 'wildviz' which requires it, so please move rnoaa to Suggests and use it conditionally before that date.
@sckott - any ideas or suggestions on how to see if itβs writing to that folder on a Mac still? I donβt have one currently and am very new to docker.
I would add skip_on_cran for this test block https://github.com/ropensci/rnoaa/blob/master/tests/testthat/test-ersst.R#L28-L36 - some of those test lines create the directory that he's so mad about - skipping those tests won't create it.
Just ran tests on my mac, i'd also skip_on_cran all the tests that create these folders:
Other things:
rappdirs is still used once in tests https://github.com/ropensci/rnoaa/blob/master/tests/testthat/test-ersst.R#L4 - so that should be removed, and rappdirs removed from imports - and this removed
the onload file https://github.com/ropensci/rnoaa/blob/master/R/onload.R has the creation of these cache folder objects - but nothing in that file creates anything on disk, only creates the R objects to handle throughout the pkg
Daniel,
Do you need something checked on a Mac?
Haven't done any coding in a long time (ie. in the dark ages before github, etc) but I am presently running several Macpros on High Sierra, Mojave and Catalina and may be able to help.
Could put one of the newer operating systems on a spare drive if needed.
Best
Ken
On 11/24/21 10:13 AM, Daniel J. Hocking wrote:
Unfortunately the fix apparently was not successful/sufficient. This is from Brian Ripley:
See the message below to the then maintainer of 'rnoaa'. rnoaa has a new version and maintainer but still writes in the prohibited area. It is now scheduled for archival on Nov 30. That will necessitate archiving 'wildviz' which requires it, so please move rnoaa to Suggests and use it conditionally before that date.
@sckott https://github.com/sckott - any ideas or suggestions on how to see if itβs writing to that folder on a Mac still? I donβt have one currently and am very new to docker.
β You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-978023009, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFN5OBEIQJZBSDXODC3UNUFKRANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Thanks @sckott I completely missed that the rappdirs function was used above the individual tests in that script and was a bit panicked with the timeframe around the US holiday. I think it should be good now with rappdirs fully removed from the package in place of tools and those additional skip_on_cran test calls.
@kjschaudt - I think it's good to go. If you have time in the next day or two to build the package, run the tests, and see if anything gets written to ~/Library/Caches/R
, it would definitely be appreciated. No worries if you don't have the time. I'll plan to do the cran release the evening of 28 November (tomorrow) or 29 November if you plan to try it but need another day.
Thanks to both of you
Daniel,
1) Which package should I build it from? https://cran.r-project.org/src/contrib/rnoaa_1.3.7.tar.gz, https://github.com/ropensci/rnoaa.git, or something else?
2) Is https://github.com/ropensci/rnoaa/blob/master/tests/testthat/test-ersst.R#L28-L36 the correct test block?
Β I should be able to immediately test it on Catalina and Mojave where I probably have all of the required compilers installed.Β If there is a need, I could give High Sierra a test.Β Β Β Unclear about the time needed to setup the newer versions of the OS.
On 11/27/21 4:54 PM, Daniel J. Hocking wrote:
Thanks @sckott https://github.com/sckott I completely missed that the rappdirs function was used above the individual tests in that script and was a bit panicked with the timeframe around the US holiday. I think it should be good now with rappdirs fully removed from the package in place of tools and those additional skip_on_cran test calls.
@kjschaudt https://github.com/kjschaudt - I think it's good to go. If you have time in the next day or two to build the package, run the tests, and see if anything gets written to |~/Library/Caches/R|, it would definitely be appreciated. No worries if you don't have the time. I'll plan to do the cran release the evening of 28 November (tomorrow) or 29 November if you plan to try it but need another day.
Thanks to both of you
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980802529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFMCJRTVJS7VVPC4WRLUOFOQRANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Ken,
1) I know v1.3.7 on CRAN writes to an unapproved location, so it's the current version on GitHub (1.3.8) that I want to make sure doesn't write to that folder.
2) Yes, that is the correct test block, but if possible also running all the tests to see if anything ever gets written to ~/Library/Caches/R
would be ideal. I use devtools::test()
to run them all on the version cloned from GitHub.
We have the package built and tested on the current version of Mac OS via GitHub actions, so I am confident that all the tests work, but CRAN doesn't like that cache file location and I'm not sure how to be sure without running it on a Mac. As such, I think just running it on Catalina (or whichever is most convenient for you) would be sufficient. But again, it's not a big deal if it's more hassle than it's worth.
Thanks!
Best way to installΒ 1.3.8?
Following didn't work
install.packages("devtools") devtools::install_github("rnoaa", "ropensci") library('rnoaa')
On 11/27/21 6:07 PM, Daniel J. Hocking wrote:
Ken,
1.
I know v1.3.7 on CRAN writes to an unapproved location, so it's the current version on GitHub (1.3.8) that I want to make sure doesn't write to that folder.
2.
Yes, that is the correct test block, but if possible also running all the tests to see if anything ever gets written to |~/Library/Caches/R| would be ideal. I use |devtools::test()| to run them all on the version cloned from GitHub.
We have the package built and tested on the current version of Mac OS via GitHub actions, so I am confident that all the tests work, but CRAN doesn't like that cache file location and I'm not sure how to be sure without running it on a Mac. As such, I think just running it on Catalina (or whichever is most convenient for you) would be sufficient. But again, it's not a big deal if it's more hassle than it's worth.
Thanks!
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980810072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFOSMGZ46JENSFFHBGLUOFXF5ANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
This failed.Β Β Is there a better way to install 1.3.8?
library(githubinstall) gh_install_packages("rnoaa", ref = "v1.3.8") Select a number or, hit 0 to cancel.
1: Cesar-Urteaga/rnoaaΒ An R package to get, clean, and visualize earthquake data from the NOAA. 2: leighseverson/rnoaaΒ R interface to many NOAA data APIs http://ropensci.org/tutorials/rnoaa_tutorial.html (now with moar crunchy meteo goodness!) 3: ropensci/rnoaaΒ Β Β Β Β Β R interface to many NOAA data APIs 4: ropenscilabs/rnoaaΒ Β R interface to many NOAA data APIs http://ropensci.org/tutorials/rnoaa_tutorial.html (now with moar crunchy meteo goodness!)
Selection: 3 Suggestion: Β - ropensci/rnoaaΒ R interface to many NOAA data APIs Do you want to install the package (Y/n)?Β Y Error: Failed to install 'unknown package' from GitHub: Β HTTP error 404. Β No commit found for the ref v1.3.8
Β Did you spell the repo owner (ropensci
) and repo name (rnoaa
)
correctly?
Β - If spelling is correct, check that you have the required
permissions to access the repo.
In addition: Warning message:
In fread(download_url, sep = "\t", header = FALSE, stringsAsFactors =
FALSE,Β :
Β Found and resolved improper quoting out-of-sample. First healed line
4848: <<PurineyΒ Β Β honfleuRΒ Β Β "Evening, honfleuR" by Seurat>>. If the
fields are not quoted (e.g. field separator does not appear within any
field), try quote="" to avoid this warning.
On 11/27/21 6:07 PM, Daniel J. Hocking wrote:
Ken,
1.
I know v1.3.7 on CRAN writes to an unapproved location, so it's the current version on GitHub (1.3.8) that I want to make sure doesn't write to that folder.
2.
Yes, that is the correct test block, but if possible also running all the tests to see if anything ever gets written to |~/Library/Caches/R| would be ideal. I use |devtools::test()| to run them all on the version cloned from GitHub.
We have the package built and tested on the current version of Mac OS via GitHub actions, so I am confident that all the tests work, but CRAN doesn't like that cache file location and I'm not sure how to be sure without running it on a Mac. As such, I think just running it on Catalina (or whichever is most convenient for you) would be sufficient. But again, it's not a big deal if it's more hassle than it's worth.
Thanks!
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980810072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFOSMGZ46JENSFFHBGLUOFXF5ANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Daniel.
After doing the following, I found R wrote an empty folder (noaa_ersst) to |~/Library/Caches/R|
Here's what I did
I appear to have loaded v1.3.8 using the following.
install_github("https://github.com/ropensci/rnoaa")
needed to install testthat to run test-errsst.r. Β Pasted that into a local file and ran it.
context("ersst") Error in context("ersst") : could not find function "context"
delete any cached files
ersst_dir <- tools::R_user_dir("rnoaa/ersst", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools' unlink(list.files(ersst_dir, full.names = TRUE)) Error in list.files(ersst_dir, full.names = TRUE) : Β object 'ersst_dir' not found
test_that("errst works with valid character and numeric input", { +Β Β skip_on_cran() +Β Β skip_if_government_down() + +Β Β vcr::use_cassette("ersst1", { +Β Β Β Β expect_is(ersst(year = 2016, month = 06), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst2", { +Β Β Β Β expect_is(ersst(year = 2016, month = 7), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst3", { +Β Β Β Β expect_is(ersst(year = "2016", month = 8), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst4", { +Β Β Β Β expect_is(ersst(year = "2016", month = "09"), "ncdf4") +Β Β })
- }) Error in test_that("errst works with valid character and numeric input",Β : Β could not find function "test_that"
test_that("errst fails well", { +Β Β skip_on_cran() + +Β Β expect_error(ersst(year = 2016), "argument \"month\" is missing") +Β Β expect_error(ersst(month = 10), "argument \"year\" is missing") +Β Β expect_error(ersst(year = 1853, month = 10), "year must be > 1853") +Β Β expect_error(ersst(year = 2015, month = 100), +Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β "month must be a length 1 or 2 month value") +Β Β expect_error(ersst(year = 2015, month = 13), +Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β "month must be a number between 1 and 12")
- }) Error in test_that("errst fails well", { : Β could not find function "test_that"
delete any cached files
ersst_dir <- tools::R_user_dir("rnoaa/ersst", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools' unlink(list.files(ersst_dir, full.names = TRUE)) Error in list.files(ersst_dir, full.names = TRUE) : Β object 'ersst_dir' not found
test_that("errst works with valid character and numeric input", { +Β Β skip_on_cran() +Β Β skip_if_government_down() + +Β Β vcr::use_cassette("ersst1", { +Β Β Β Β expect_is(ersst(year = 2016, month = 06), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst2", { +Β Β Β Β expect_is(ersst(year = 2016, month = 7), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst3", { +Β Β Β Β expect_is(ersst(year = "2016", month = 8), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst4", { +Β Β Β Β expect_is(ersst(year = "2016", month = "09"), "ncdf4") +Β Β })
- }) Error in test_that("errst works with valid character and numeric input",Β : Β could not find function "test_that"
test_that("errst fails well", { +Β Β skip_on_cran() + +Β Β expect_error(ersst(year = 2016), "argument \"month\" is missing") +Β Β expect_error(ersst(month = 10), "argument \"year\" is missing") +Β Β expect_error(ersst(year = 1853, month = 10), "year must be > 1853") +Β Β expect_error(ersst(year = 2015, month = 100), +Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β "month must be a length 1 or 2 month value") +Β Β expect_error(ersst(year = 2015, month = 13), +Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β "month must be a number between 1 and 12")
- }) Error in test_that("errst fails well", { : Β could not find function "test_that" install.packages("testthat") Error in install.packages : Updating loaded packages
Restarting R session...
install.packages("testthat") trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/testthat_3.1.0.tgz' Content type 'application/x-gzip' length 2929156 bytes (2.8 MB)
downloaded 2.8 MB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//Rtmpd5mLDW/downloaded_packages
library(testthat) library(devtools) Loading required package: usethis
Attaching package: βdevtoolsβ
The following object is masked from βpackage:testthatβ:
Β Β Β test_file
library(rnoaa) context("ersst")
delete any cached files
ersst_dir <- tools::R_user_dir("rnoaa/ersst", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools' unlink(list.files(ersst_dir, full.names = TRUE)) Error in list.files(ersst_dir, full.names = TRUE) : Β object 'ersst_dir' not found
test_that("errst works with valid character and numeric input", { +Β Β skip_on_cran() +Β Β skip_if_government_down() + +Β Β vcr::use_cassette("ersst1", { +Β Β Β Β expect_is(ersst(year = 2016, month = 06), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst2", { +Β Β Β Β expect_is(ersst(year = 2016, month = 7), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst3", { +Β Β Β Β expect_is(ersst(year = "2016", month = 8), "ncdf4") +Β Β }) + +Β Β vcr::use_cassette("ersst4", { +Β Β Β Β expect_is(ersst(year = "2016", month = "09"), "ncdf4") +Β Β })
- }) ββ Error (Line 3): errst works with valid character and numeric input βββββββββββββββββββββ Error in
skip_if_government_down()
: could not find function "skip_if_government_down"
Error: Test failed
test_that("errst fails well", { +Β Β skip_on_cran() + +Β Β expect_error(ersst(year = 2016), "argument \"month\" is missing") +Β Β expect_error(ersst(month = 10), "argument \"year\" is missing") +Β Β expect_error(ersst(year = 1853, month = 10), "year must be > 1853") +Β Β expect_error(ersst(year = 2015, month = 100), +Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β "month must be a length 1 or 2 month value") +Β Β expect_error(ersst(year = 2015, month = 13), +Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β "month must be a number between 1 and 12")
- }) Test passed
On 11/27/21 4:54 PM, Daniel J. Hocking wrote:
Thanks @sckott https://github.com/sckott I completely missed that the rappdirs function was used above the individual tests in that script and was a bit panicked with the timeframe around the US holiday. I think it should be good now with rappdirs fully removed from the package in place of tools and those additional skip_on_cran test calls.
@kjschaudt https://github.com/kjschaudt - I think it's good to go. If you have time in the next day or two to build the package, run the tests, and see if anything gets written to |~/Library/Caches/R|, it would definitely be appreciated. No worries if you don't have the time. I'll plan to do the cran release the evening of 28 November (tomorrow) or 29 November if you plan to try it but need another day.
Thanks to both of you
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980802529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFMCJRTVJS7VVPC4WRLUOFOQRANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Ken - thanks for your persistence with this!!! As a result, I think I might know what we need to change.
Can you run each of the following and let me know the results:
tools::R_user_dir("rnoaa")
tools::R_user_dir("rnoaa", which = "cache")
Running on Mojave,Rstudio 1.2.5033 Nothing written to the library cache.
Results of the 2 tests follow ==> Testing R file using 'testthat' ββ
Testing RnoaaTEst.R
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ [ FAIL 1 |
WARN 0 | SKIP 0 | PASS 0 ] ββ Error (RnoaaTEst.R:10:1): (code run
outside of test_that()
) βββββββββββββββ Error: 'R_user_dir' is not an
exported object from 'namespace:tools' Backtrace: 1. tools::R_user_dir
RnoaaTEst.R:10:0 2. base::getExportedValue(pkg, name) [ FAIL 1 | WARN 0
| SKIP 0 | PASS 0 ] Test complete ==> Testing R file using 'testthat' ββ
Testing RnoaaTEst.R
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ [ FAIL 1 |
WARN 0 | SKIP 0 | PASS 0 ] ββ Error (RnoaaTEst.R:10:1): (code run
outside of test_that()
) βββββββββββββββ Error: 'R_user_dir' is not an
exported object from 'namespace:tools' Backtrace: 1. tools::R_user_dir
RnoaaTEst.R:10:0 2. base::getExportedValue(pkg, name) [ FAIL 1 | WARN 0
| SKIP 0 | PASS 0 ] Test complete
On 11/27/21 8:06 PM, Daniel J. Hocking wrote:
Ken - thanks for your persistence with this!!! As a result, I think I might know what we need to change.
Can you run each of the following and let me know the results:
tools::R_user_dir("rnoaa") tools::R_user_dir("rnoaa",which = "cache")
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980822772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFIDWMFZFZLDDDJFIW3UOGFBRANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hmm, interesting. What about just these two lines outside of any test on Catalina?
tools::R_user_dir("rnoaa")
tools::R_user_dir("rnoaa", which = "cache")
From the terminal, the R console or?
On 11/27/21 8:31 PM, Daniel J. Hocking wrote:
Hmm, interesting. What about just these two lines outside of any test on Catalina?
tools::R_user_dir("rnoaa") tools::R_user_dir("rnoaa",which = "cache")
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980824966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFO44KH3DBWK6GBRHJLUOGH7PANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Not sure if I am properly loading the program from R since I have almost 0 experience with github, am an old school fortran coder who went to SAS for 20 years and then R for the last 10.
Can't rule out an operator error on this side.
On 11/27/21 8:31 PM, Daniel J. Hocking wrote:
tools::R_user_dir("rnoaa",which = "cache")
Each of those two lines can be run in the R console. Those are used internally in the package and are causing the problem. I'm thinking that the version without which = "cache"
might solve the problem but I'll be curious to see the directory output of each.
git and GitHub are great but there's certainly a learning curve. Same with R. It's so unstructured relative to many other programming languages and the package developments are so fast that it's almost too flexible.
Not sure if I understand what you mean by "outside of any test".Β Β I assume you meant for me not to make the library(testthat)Β or not call devtools::test("test-errst.R")
Also not sure if I am correctly installing the file from github / running the tests you requested.Β Β Β Willing to learn if you can pass along specific commands.
Here's my last attempt.Β Β starting from a clean Rstudio session in Mojave, here are the results.
First, nothing was written in library/cache/r
R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Β Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
library(githubinstall) library(devtools) Loading required package: usethis install_github("https://github.com/ropensci/rnoaa") Downloading GitHub repo @.*** βΒ checking for file β/private/var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T/Rtmp1z4uZ7/remotes13d11bf00dd1/ropensci-rnoaa-7a3c3c4/DESCRIPTIONβ ... βΒ preparing βrnoaaβ: (581ms) βΒ checking DESCRIPTION meta-information ... βΒ checking for LF line-endings in source and make files and shell scripts βΒ checking for empty or unneeded directories Β Β Removed empty directory βrnoaa/vignettesβ βΒ looking to see if a βdata/datalistβ file should be added βΒ building βrnoaa_1.3.8.tar.gzβ
DONE (rnoaa)
library(rnoaa) Registered S3 method overwritten by 'hoardr': Β methodΒ Β Β Β Β Β Β Β Β Β from Β print.cache_info httr
tools::R_user_dir("rnoaa") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
tools::R_user_dir("rnoaa", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
On 11/27/21 8:31 PM, Daniel J. Hocking wrote:
Hmm, interesting. What about just these two lines outside of any test on Catalina?
tools::R_user_dir("rnoaa") tools::R_user_dir("rnoaa",which = "cache")
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980824966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFO44KH3DBWK6GBRHJLUOGH7PANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Thanks! What you ran is exactly what I was looking for. Interestingly and unfortunately the solution doesnβt appear to work on R 3.6 (thatβs the namespace error).
Could you run those two lines on the Catalina system with R version >= 4.0?
Sent from a handheld device.
On Nov 28, 2021, at 12:36 AM, kjschaudt @.***> wrote:
ο»Ώ Not sure if I understand what you mean by "outside of any test". I assume you meant for me not to make the library(testthat) or not call devtools::test("test-errst.R")
Also not sure if I am correctly installing the file from github / running the tests you requested. Willing to learn if you can pass along specific commands.
Here's my last attempt. starting from a clean Rstudio session in Mojave, here are the results.
First, nothing was written in library/cache/r
R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
library(githubinstall) library(devtools) Loading required package: usethis install_github("https://github.com/ropensci/rnoaa") Downloading GitHub repo @.*** β checking for file β/private/var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T/Rtmp1z4uZ7/remotes13d11bf00dd1/ropensci-rnoaa-7a3c3c4/DESCRIPTIONβ ... β preparing βrnoaaβ: (581ms) β checking DESCRIPTION meta-information ... β checking for LF line-endings in source and make files and shell scripts β checking for empty or unneeded directories Removed empty directory βrnoaa/vignettesβ β looking to see if a βdata/datalistβ file should be added β building βrnoaa_1.3.8.tar.gzβ
- installing source package βrnoaaβ ... using staged installation R data moving datasets to lazyload DB inst byte-compile and prepare package for lazy loading help installing help indices * copying figures building package indices testing if installed package can be loaded from temporary location testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path
- DONE (rnoaa)
library(rnoaa) Registered S3 method overwritten by 'hoardr': method from print.cache_info httr
tools::R_user_dir("rnoaa") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
tools::R_user_dir("rnoaa", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
On 11/27/21 8:31 PM, Daniel J. Hocking wrote:
Hmm, interesting. What about just these two lines outside of any test on Catalina?
tools::R_user_dir("rnoaa") tools::R_user_dir("rnoaa",which = "cache")
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-980824966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFO44KH3DBWK6GBRHJLUOGH7PANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
β You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
FromΒ R version 4.1.2 downloaded from the Microsoft Site, I get the following errors trying to install what appears to be the required librarys.Β Devtools, etc are not available.Β Β Will see if I can get RStudio (with R4+) running on my test Catalina box.
R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Β Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
[R.app GUI 1.70 (7405) x86_64-apple-darwin17.0]
install.packages("githubinstall") Warning: unable to access index for repository http://cran.revolutionanalytics.com/src/contrib: Β cannot open URL 'http://cran.revolutionanalytics.com/src/contrib/PACKAGES' Warning: unable to access index for repository http://cran.revolutionanalytics.com/bin/macosx/contrib/4.1: Β cannot open URL 'http://cran.revolutionanalytics.com/bin/macosx/contrib/4.1/PACKAGES' Warning message: package βgithubinstallβ is not available for this version of R
A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
library(githubinstall) Error in library(githubinstall) : Β there is no package called βgithubinstallβ install.packages("devtools") Warning: unable to access index for repository http://cran.revolutionanalytics.com/src/contrib: Β cannot open URL 'http://cran.revolutionanalytics.com/src/contrib/PACKAGES' Warning: unable to access index for repository http://cran.revolutionanalytics.com/bin/macosx/contrib/4.1: Β cannot open URL 'http://cran.revolutionanalytics.com/bin/macosx/contrib/4.1/PACKAGES' Warning message: package βdevtoolsβ is not available for this version of R
A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
library(devtools) Error in library(devtools) : there is no package called βdevtoolsβ install_github("https://github.com/ropensci/rnoaa") Error in install_github("https://github.com/ropensci/rnoaa") : Β could not find function "install_github" install.packages("testthat") Warning: unable to access index for repository http://cran.revolutionanalytics.com/src/contrib: Β cannot open URL 'http://cran.revolutionanalytics.com/src/contrib/PACKAGES' Warning: unable to access index for repository http://cran.revolutionanalytics.com/bin/macosx/contrib/4.1: Β cannot open URL 'http://cran.revolutionanalytics.com/bin/macosx/contrib/4.1/PACKAGES' Warning message: package βtestthatβ is not available for this version of R
A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
On 11/28/21 7:00 AM, Daniel J. Hocking wrote:
Thanks! What you ran is exactly what I was looking for. Interestingly and unfortunately the solution doesnβt appear to work on R 3.6 (thatβs the namespace error).
Could you run those two lines on the Catalina system with R version >= 4.0?
Sent from a handheld device.
On Nov 28, 2021, at 12:36 AM, kjschaudt @.***> wrote:
ο»Ώ Not sure if I understand what you mean by "outside of any test". I assume you meant for me not to make the library(testthat) or not call devtools::test("test-errst.R")
Also not sure if I am correctly installing the file from github / running the tests you requested. Willing to learn if you can pass along specific commands.
Here's my last attempt. starting from a clean Rstudio session in Mojave, here are the results.
First, nothing was written in library/cache/r
R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
library(githubinstall) library(devtools) Loading required package: usethis install_github("https://github.com/ropensci/rnoaa") Downloading GitHub repo @.*** β checking for file
β/private/var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T/Rtmp1z4uZ7/remotes13d11bf00dd1/ropensci-rnoaa-7a3c3c4/DESCRIPTIONβ
... β preparing βrnoaaβ: (581ms) β checking DESCRIPTION meta-information ... β checking for LF line-endings in source and make files and shell scripts β checking for empty or unneeded directories Removed empty directory βrnoaa/vignettesβ β looking to see if a βdata/datalistβ file should be added β building βrnoaa_1.3.8.tar.gzβ
- installing source package βrnoaaβ ... using staged installation R data moving datasets to lazyload DB inst byte-compile and prepare package for lazy loading help installing help indices * copying figures building package indices testing if installed package can be loaded from temporary location testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path
- DONE (rnoaa)
library(rnoaa) Registered S3 method overwritten by 'hoardr': method from print.cache_info httr
tools::R_user_dir("rnoaa") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
tools::R_user_dir("rnoaa", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
On 11/27/21 8:31 PM, Daniel J. Hocking wrote:
Hmm, interesting. What about just these two lines outside of any test on Catalina?
tools::R_user_dir("rnoaa") tools::R_user_dir("rnoaa",which = "cache")
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub
https://github.com/ropensci/rnoaa/issues/403#issuecomment-980824966, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFBHLFO44KH3DBWK6GBRHJLUOGH7PANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
β You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-981081580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFOEAXCEBVAJM773ARLUOIRWDANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
The test librarys loaded in R Studio but not R.Β Β Interesting to know.
tools::R_user_dir("rnoaa") [1] "/Volumes/SG8GB/Users/schaudt/Library/Application Support/org.R-project.R/R/rnoaa"
tools::R_user_dir("rnoaa", which = "cache") [1] "/Volumes/SG8GB/Users/schaudt/Library/Caches/org.R-project.R/R/rnoaa"
devtools::test() Error: Could not find package root. Is your working directory inside a package?
####### installation of rnoaa 1.3.8 follows
R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Β Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
[Workspace loaded from ~/.RData]
install.packages("githubinstall") also installing the dependencies βcredentialsβ, βgitcredsβ, βiniβ, βgertβ, βghβ, βwhiskerβ, βxopenβ, βbrewβ, βcommonmarkβ, βusethisβ, βpkgbuildβ, βrcmdcheckβ, βroxygen2β, βrversionsβ, βsessioninfoβ, βdevtoolsβ, βmockeryβ
downloaded 167 KB
downloaded 89 KB
downloaded 12 KB
downloaded 2.0 MB
downloaded 134 KB
downloaded 63 KB
downloaded 21 KB
downloaded 104 KB
downloaded 303 KB
downloaded 751 KB
downloaded 137 KB
downloaded 164 KB
downloaded 839 KB
downloaded 63 KB
downloaded 181 KB
downloaded 384 KB
downloaded 38 KB
downloaded 61 KB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//RtmpvhngYt/downloaded_packages
library(githubinstall) install.packages("devtools") Error in install.packages : Updating loaded packages
Restarting R session...
install.packages("devtools") trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/devtools_2.4.2.tgz' Content type 'application/x-gzip' length 393913 bytes (384 KB)
downloaded 384 KB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//RtmpjbcT0U/downloaded_packages
library(devtools) Loading required package: usethis install_github("https://github.com/ropensci/rnoaa") Downloading GitHub repo @.*** These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?
1: All 2: CRAN packages only 3: None 4: cpp11Β (0.4.0 -> 0.4.1) [CRAN] 5: glueΒ Β (1.4.2 -> 1.5.0) [CRAN] 6: tibble (3.1.5 -> 3.1.6) [CRAN]
downloaded 297 KB
downloaded 142 KB
downloaded 826 KB
downloaded 1015 KB
downloaded 187 KB
downloaded 31 KB
downloaded 935 KB
downloaded 350 KB
downloaded 61 KB
downloaded 757 KB
downloaded 3.6 MB
downloaded 624 KB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//RtmpjbcT0U/downloaded_packages βΒ checking for file β/private/var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T/RtmpjbcT0U/remotes1064511d10a5/ropensci-rnoaa-7a3c3c4/DESCRIPTIONβ (368ms) βΒ preparing βrnoaaβ: (505ms) βΒ checking DESCRIPTION meta-information ... βΒ checking for LF line-endings in source and make files and shell scripts βΒ checking for empty or unneeded directories Β Β Removed empty directory βrnoaa/vignettesβ βΒ building βrnoaa_1.3.8.tar.gzβ
library(rnoaa)
On 11/28/21 7:00 AM, Daniel J. Hocking wrote:
Thanks! What you ran is exactly what I was looking for. Interestingly and unfortunately the solution doesnβt appear to work on R 3.6 (thatβs the namespace error).
Could you run those two lines on the Catalina system with R version >= 4.0?
Sent from a handheld device.
On Nov 28, 2021, at 12:36 AM, kjschaudt @.***> wrote:
ο»Ώ Not sure if I understand what you mean by "outside of any test". I assume you meant for me not to make the library(testthat) or not call devtools::test("test-errst.R")
Also not sure if I am correctly installing the file from github / running the tests you requested. Willing to learn if you can pass along specific commands.
Here's my last attempt. starting from a clean Rstudio session in Mojave, here are the results.
First, nothing was written in library/cache/r
R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
library(githubinstall) library(devtools) Loading required package: usethis install_github("https://github.com/ropensci/rnoaa") Downloading GitHub repo @.*** β checking for file
β/private/var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T/Rtmp1z4uZ7/remotes13d11bf00dd1/ropensci-rnoaa-7a3c3c4/DESCRIPTIONβ
... β preparing βrnoaaβ: (581ms) β checking DESCRIPTION meta-information ... β checking for LF line-endings in source and make files and shell scripts β checking for empty or unneeded directories Removed empty directory βrnoaa/vignettesβ β looking to see if a βdata/datalistβ file should be added β building βrnoaa_1.3.8.tar.gzβ
- installing source package βrnoaaβ ... using staged installation R data moving datasets to lazyload DB inst byte-compile and prepare package for lazy loading help installing help indices * copying figures building package indices testing if installed package can be loaded from temporary location testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path
- DONE (rnoaa)
library(rnoaa) Registered S3 method overwritten by 'hoardr': method from print.cache_info httr
tools::R_user_dir("rnoaa") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
tools::R_user_dir("rnoaa", which = "cache") Error: 'R_user_dir' is not an exported object from 'namespace:tools'
On 11/27/21 8:31 PM, Daniel J. Hocking wrote:
Hmm, interesting. What about just these two lines outside of any test on Catalina?
tools::R_user_dir("rnoaa") tools::R_user_dir("rnoaa",which = "cache")
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub
https://github.com/ropensci/rnoaa/issues/403#issuecomment-980824966, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFBHLFO44KH3DBWK6GBRHJLUOGH7PANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
β You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/403#issuecomment-981081580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHLFOEAXCEBVAJM773ARLUOIRWDANCNFSM5HVZQ7XQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
One more test log from Catalina follows.Β Β Β Although the default is to put the user files on the boot drive, I normally have my user files/ desktop / library on an alternate drive.Β Β On this Catalina test, I used the default.
Results from the two requested tools calls follows here and is included below in sequence in the log.
tools::R_user_dir("rnoaa")
[1] "/Users/schaudt/Library/Application Support/org.R-project.R/R/rnoaa"
tools::R_user_dir("rnoaa", which = "cache") [1] "/Users/schaudt/Library/Caches/org.R-project.R/R/rnoaa"
I was again unable to use testhat or devtools::test() to run your test code. WOULD BE PLEASED TO LEARN HOW TO DO THAT. Therefore, I pasted the into my RStudio session and executed it. Results are in the log below.
None of the runs wrote anything toΒ ~/library/cache/R
On 11/28/21 7:00 AM, Daniel J. Hocking wrote:
Thanks! What you ran is exactly what I was looking for. Interestingly and unfortunately the solution doesnβt appear to work on R 3.6 (thatβs the namespace error).
Could you run those two lines on the Catalina system with R version >= 4.0?
R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Β Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
install.packages("githubinstall") trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/githubinstall_0.2.2.tgz' Content type 'application/x-gzip' length 63322 bytes (61 KB)
downloaded 61 KB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//Rtmpsi85qr/downloaded_packages
install.packages("githubinstall") trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/githubinstall_0.2.2.tgz' Content type 'application/x-gzip' length 63322 bytes (61 KB)
downloaded 61 KB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//Rtmpsi85qr/downloaded_packages
library(githubinstall) install.packages("testthat") Error in install.packages : Updating loaded packages
Restarting R session...
install.packages("testthat") trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/testthat_3.1.0.tgz' Content type 'application/x-gzip' length 2949801 bytes (2.8 MB)
downloaded 2.8 MB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//RtmpCluA6k/downloaded_packages
library(testthat) install.packages("devtools") trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/devtools_2.4.2.tgz' Content type 'application/x-gzip' length 393913 bytes (384 KB)
downloaded 384 KB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//RtmpCluA6k/downloaded_packages
library(devtools) Loading required package: usethis
Attaching package: βdevtoolsβ
The following object is masked from βpackage:testthatβ:
Β Β Β test_file
install_github("https://github.com/ropensci/rnoaa") Skipping install of 'rnoaa' from a github remote, the SHA1 (7a3c3c42) has not changed since last install. Β Use
force = TRUE
to force installation tools::R_user_dir("rnoaa") [1] "/Users/schaudt/Library/Application Support/org.R-project.R/R/rnoaa" tools::R_user_dir("rnoaa", which = "cache") [1] "/Users/schaudt/Library/Caches/org.R-project.R/R/rnoaa"getwd() [1] "/Users/schaudt" setwd("/Volumes/SG8GB/Users/schaudt/R_Projects") getwd() [1] "/Volumes/SG8GB/Users/schaudt/R_Projects" devtools::test(file="test-ersst.R") Error: Could not find package root. Is your working directory inside a package? devtools::test() Error: Could not find package root. Is your working directory inside a package? test() Error: Could not find package root. Is your working directory inside a package? context("ersst")
delete any cached files
ersst_dir <- tools::R_user_dir("rnoaa/ersst", which = "cache") unlink(list.files(ersst_dir, full.names = TRUE)) test_that("errst works with valid character and numeric input", {
- skip_on_cran()
- skip_if_government_down()
- vcr::use_cassette("ersst1", {
- expect_is(ersst(year = 2016, month = 06), "ncdf4")
- })
- vcr::use_cassette("ersst2", {
- expect_is(ersst(year = 2016, month = 7), "ncdf4")
- })
- vcr::use_cassette("ersst3", {
- expect_is(ersst(year = "2016", month = 8), "ncdf4")
- })
- vcr::use_cassette("ersst4", {
- expect_is(ersst(year = "2016", month = "09"), "ncdf4")
- })
- }) ββ Error (Line 3): errst works with valid character and numeric input βββββββββββββββββββββ Error in
skip_if_government_down()
: could not find function "skip_if_government_down"
Error: Test failed
test_that("errst fails well", {
- skip_on_cran()
- expect_error(ersst(year = 2016), "argument \"month\" is missing")
- expect_error(ersst(month = 10), "argument \"year\" is missing")
- expect_error(ersst(year = 1853, month = 10), "year must be > 1853")
- expect_error(ersst(year = 2015, month = 100),
- "month must be a length 1 or 2 month value")
- expect_error(ersst(year = 2015, month = 13),
- "month must be a number between 1 and 12")
- }) ββ Failure (Line 3): errst fails well ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 2016)
threw an error with unexpected message. Expected match: "argument \"month\" is missing" Actual message: "could not find function \"ersst\"" Backtrace: Β 1. testthat::expect_error(ersst(year = 2016), "argument \"month\" is missing") Β 2. testthat:::quasi_capture(...) Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 4): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(month = 10)
threw an error with unexpected message.
Expected match: "argument \"year\" is missing"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(month = 10), "argument \"year\" is
missing")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 5): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 1853, month = 10)
threw an error with unexpected message.
Expected match: "year must be > 1853"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(year = 1853, month = 10), "year must
be > 1853")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 6): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 2015, month = 100)
threw an error with unexpected message.
Expected match: "month must be a length 1 or 2 month value"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(year = 2015, month = 100), "month must
be a length 1 or 2 month value")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 8): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 2015, month = 13)
threw an error with unexpected message.
Expected match: "month must be a number between 1 and 12"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(year = 2015, month = 13), "month must
be a number between 1 and 12")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
Error: Test failed
delete any cached files
ersst_dir <- tools::R_user_dir("rnoaa/ersst", which = "cache") unlink(list.files(ersst_dir, full.names = TRUE)) test_that("errst works with valid character and numeric input", {
- skip_on_cran()
- skip_if_government_down()
- vcr::use_cassette("ersst1", {
- expect_is(ersst(year = 2016, month = 06), "ncdf4")
- })
- vcr::use_cassette("ersst2", {
- expect_is(ersst(year = 2016, month = 7), "ncdf4")
- })
- vcr::use_cassette("ersst3", {
- expect_is(ersst(year = "2016", month = 8), "ncdf4")
- })
- vcr::use_cassette("ersst4", {
- expect_is(ersst(year = "2016", month = "09"), "ncdf4")
- })
- }) ββ Error (Line 3): errst works with valid character and numeric input βββββββββββββββββββββ Error in
skip_if_government_down()
: could not find function "skip_if_government_down"
Error: Test failed
test_that("errst fails well", {
- skip_on_cran()
- expect_error(ersst(year = 2016), "argument \"month\" is missing")
- expect_error(ersst(month = 10), "argument \"year\" is missing")
- expect_error(ersst(year = 1853, month = 10), "year must be > 1853")
- expect_error(ersst(year = 2015, month = 100),
- "month must be a length 1 or 2 month value")
- expect_error(ersst(year = 2015, month = 13),
- "month must be a number between 1 and 12")
- }) ββ Failure (Line 3): errst fails well ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 2016)
threw an error with unexpected message. Expected match: "argument \"month\" is missing" Actual message: "could not find function \"ersst\"" Backtrace: Β 1. testthat::expect_error(ersst(year = 2016), "argument \"month\" is missing") Β 2. testthat:::quasi_capture(...) Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 4): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(month = 10)
threw an error with unexpected message.
Expected match: "argument \"year\" is missing"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(month = 10), "argument \"year\" is
missing")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 5): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 1853, month = 10)
threw an error with unexpected message.
Expected match: "year must be > 1853"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(year = 1853, month = 10), "year must
be > 1853")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 6): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 2015, month = 100)
threw an error with unexpected message.
Expected match: "month must be a length 1 or 2 month value"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(year = 2015, month = 100), "month must
be a length 1 or 2 month value")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
ββ Failure (Line 8): errst fails well
ββββββββββββββββββββββββββββββββββββββββββ
ersst(year = 2015, month = 13)
threw an error with unexpected message.
Expected match: "month must be a number between 1 and 12"
Actual message: "could not find function \"ersst\""
Backtrace:
Β 1. testthat::expect_error(ersst(year = 2015, month = 13), "month must
be a number between 1 and 12")
Β 2. testthat:::quasi_capture(...)
Β 5. rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
Error: Test failed
Thanks for stepping through all this with me. It looks like this solution should work although I think it might require R >= 4.0 for tools >= 4.0 based on the output. I'm going to finish the CRAN checks and do the release. As such, I'm going to close this issue.
@kjschaudt wrt:
I was again unable to use testhat or devtools::test() to run your test code. WOULD BE PLEASED TO LEARN HOW TO DO THAT.
I think for devtools and testthat to really function as expected, you want to be using RStudio and be in a project and working directory of the package source code. To do this for rnoaa for example, you would
git clone
function but the easiest option is to open RStudio and click Open New Project -> Check Out From Version Control -> GitHub -> the URL of your repository. This downloads all the files to your local machine and creates and R Project associated with it.Thanks for explaining the steps.Β Followed them and quickly was able to complete the tests after remembering to install testthat.
Since I am now running jobs that require Mojave, my initial test ranΒ R v3.6.3 from RStudio 1.2.5033.Β The tests generated the following directory and files in ~/Library/Caches/R'',
Will repeat the tests for Catalina / R 4.x when I reboot.
Test log follows
R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Β Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
devtools::test() βΉ Loading rnoaa Registered S3 method overwritten by 'httr': Β methodΒ Β Β Β Β Β Β Β Β Β from Β print.cache_info hoardr βΉ Testing rnoaa β | F W SΒ OK | Context β |Β Β Β Β Β Β Β 27 | arc2 [5.0s] β |Β Β Β Β Β Β Β 21 | buoy [43.6s] β |Β Β Β Β Β Β Β Β 1 | check_response_swdi x | 3Β Β Β Β Β Β 0 | check_response [1.1s] βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Failure (test-check_response.r:13:3): check_response works correctly on bad response content-type
ncdc(...)
threw an error with unexpected message. Expected match: "wrong response type, open an issue" Actual message: "need an API key for NOAA data" Backtrace: Β 1. testthat::expect_error(...) test-check_response.r:13:2 Β 6. rnoaa::ncdc(...) Β 7. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc.r:191:2 Β 8. base::getOption("noaakey", stop("need an API key for NOAA data")) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Error (test-check_response.r:23:3): check_response returns an error
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. testthat::expect_warning(...) test-check_response.r:23:2
Β 6. rnoaa::ncdc_locs_cats(startdate = "2100-01-01")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Error (test-check_response.r:40:3): check_response returns the correct
error messages
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. testthat::expect_warning(...) test-check_response.r:40:2
Β 6. rnoaa::ncdc_locs_cats(startdate = "2100-01-01")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β |Β Β Β Β Β Β Β 12 | coops [1.2s]
β |Β Β Β Β Β Β Β 31 | cpc_prcp [0.8s]
β |Β Β Β Β Β Β Β Β 8 | defunct
x | 1Β Β Β Β Β Β 0 | ersst
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ersst.R:4:1): (code run outside of test_that()
)
Error: 'R_user_dir' is not an exported object from 'namespace:tools'
Backtrace:
Β 1. tools::R_user_dir test-ersst.R:4:0
Β 2. base::getExportedValue(pkg, name)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β |Β Β Β Β Β Β Β 11 | ghcnd_splitvars [3.1s]
β |Β Β Β Β Β Β Β 50 | ghcnd [18.0s]
β |Β Β Β Β Β Β Β 16 | homr [35.7s]
β |Β Β Β Β Β Β Β Β 8 | isd_read [6.4s]
β |Β Β Β Β Β Β Β 45 | isd_stations [1.5s]
β |Β Β Β Β Β Β Β Β 5 | isd [14.0s]
β |Β Β Β Β Β Β Β 14 | lcd [3.0s]
β |Β Β Β Β Β Β Β 10 | meteo [16.3s]
x | 2Β Β Β Β Β Β 0 | ncdc_datacats [0.1s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ncdc_datacats.r:6:3): ncdc_datacats returns the correct ...
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. vcr::use_cassette(...) test-ncdc_datacats.r:6:2
Β 3. rnoaa::ncdc_datacats() test-ncdc_datacats.r:7:4
Β 4. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datacats.r:46:2
Β 5. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Failure (test-ncdc_datacats.r:36:3): ncdc_datacats fails well
ncdc_datacats(datacategoryid = "ANNAGR")
threw an error with
unexpected message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Β 1. testthat::expect_error(...) test-ncdc_datacats.r:36:2
Β 6. rnoaa::ncdc_datacats(datacategoryid = "ANNAGR")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datacats.r:46:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
x | 2Β Β Β Β Β Β 0 | ncdc_datasets [0.2s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ncdc_datasets.r:6:3): ncdc_datasets returns the correct class
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. vcr::use_cassette(...) test-ncdc_datasets.r:6:2
Β 3. rnoaa::ncdc_datasets() test-ncdc_datasets.r:7:4
Β 4. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datasets.r:50:2
Β 5. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Failure (test-ncdc_datasets.r:36:3): ncdc_datasets fails well
ncdc_datasets(datasetid = "ANNUAL")
threw an error with unexpected
message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Β 1. testthat::expect_error(ncdc_datasets(datasetid = "ANNUAL"),
"lexical error") test-ncdc_datasets.r:36:2
Β 6. rnoaa::ncdc_datasets(datasetid = "ANNUAL")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datasets.r:50:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
x | 2Β Β Β Β Β Β 0 | ncdc_datatypes [0.1s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ncdc_datatypes.r:6:3): ncdc_datatypes returns the correct class
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. vcr::use_cassette(...) test-ncdc_datatypes.r:6:2
Β 3. rnoaa::ncdc_datatypes(datasetid = "ANNUAL") test-ncdc_datatypes.r:7:4
Β 4. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datatypes.r:54:2
Β 5. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Failure (test-ncdc_datatypes.r:30:3): ncdc_datatypes fails well
ncdc_datatypes(datasetid = "ANNUAL")
threw an error with unexpected
message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Β 1. testthat::expect_error(...) test-ncdc_datatypes.r:30:2
Β 6. rnoaa::ncdc_datatypes(datasetid = "ANNUAL")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datatypes.r:54:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Maximum number of failures exceeded; quitting at end of file.
Increase this number with (e.g.) Sys.setenv('TESTTHAT_MAX_FAILS' = Inf)
ββ Results ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Duration: 150.5 s
[ FAIL 10 | WARN 0 | SKIP 0 | PASS 259 ] ββ Terminated early βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
library(testhat) Error in library(testhat) : there is no package called βtesthatβ
Restarting R session...
install.packages("testthat") trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/testthat_3.1.0.tgz' Content type 'application/x-gzip' length 2929156 bytes (2.8 MB)
downloaded 2.8 MB
The downloaded binary packages are in Β /var/folders/jb/p65bzs357js0yj2vw80nz9rc0000gn/T//RtmpRktCFt/downloaded_packages
devtools::test() βΉ Loading rnoaa Registered S3 method overwritten by 'httr': Β methodΒ Β Β Β Β Β Β Β Β Β from Β print.cache_info hoardr βΉ Testing rnoaa β | F W SΒ OK | Context β |Β Β Β Β Β Β Β 27 | arc2 [4.8s] β |Β Β Β Β Β Β Β 21 | buoy [42.6s] β |Β Β Β Β Β Β Β Β 1 | check_response_swdi x | 3Β Β Β Β Β Β 0 | check_response [1.3s] βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Failure (test-check_response.r:13:3): check_response works correctly on bad response content-type
ncdc(...)
threw an error with unexpected message. Expected match: "wrong response type, open an issue" Actual message: "need an API key for NOAA data" Backtrace: Β 1. testthat::expect_error(...) test-check_response.r:13:2 Β 6. rnoaa::ncdc(...) Β 7. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc.r:191:2 Β 8. base::getOption("noaakey", stop("need an API key for NOAA data")) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Error (test-check_response.r:23:3): check_response returns an error
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. testthat::expect_warning(...) test-check_response.r:23:2
Β 6. rnoaa::ncdc_locs_cats(startdate = "2100-01-01")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Error (test-check_response.r:40:3): check_response returns the correct
error messages
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. testthat::expect_warning(...) test-check_response.r:40:2
Β 6. rnoaa::ncdc_locs_cats(startdate = "2100-01-01")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β |Β Β Β Β Β Β Β 12 | coops [1.2s]
β |Β Β Β Β Β Β Β 31 | cpc_prcp [0.8s]
β |Β Β Β Β Β Β Β Β 8 | defunct
x | 1Β Β Β Β Β Β 0 | ersst
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ersst.R:4:1): (code run outside of test_that()
)
Error: 'R_user_dir' is not an exported object from 'namespace:tools'
Backtrace:
Β 1. tools::R_user_dir test-ersst.R:4:0
Β 2. base::getExportedValue(pkg, name)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β |Β Β Β Β Β Β Β 11 | ghcnd_splitvars [1.0s]
β |Β Β Β Β Β Β Β 50 | ghcnd [6.1s]
β |Β Β Β Β Β Β Β 16 | homr [1.6s]
β |Β Β Β Β Β Β Β Β 8 | isd_read [5.9s]
β |Β Β Β Β Β Β Β 45 | isd_stations [0.4s]
β |Β Β Β Β Β Β Β Β 5 | isd [1.2s]
β |Β Β Β Β Β Β Β 14 | lcd [4.5s]
β |Β Β Β Β Β Β Β 10 | meteo [5.5s]
x | 2Β Β Β Β Β Β 0 | ncdc_datacats [0.2s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ncdc_datacats.r:6:3): ncdc_datacats returns the correct ...
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. vcr::use_cassette(...) test-ncdc_datacats.r:6:2
Β 3. rnoaa::ncdc_datacats() test-ncdc_datacats.r:7:4
Β 4. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datacats.r:46:2
Β 5. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Failure (test-ncdc_datacats.r:36:3): ncdc_datacats fails well
ncdc_datacats(datacategoryid = "ANNAGR")
threw an error with
unexpected message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Β 1. testthat::expect_error(...) test-ncdc_datacats.r:36:2
Β 6. rnoaa::ncdc_datacats(datacategoryid = "ANNAGR")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datacats.r:46:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
x | 2Β Β Β Β Β Β 0 | ncdc_datasets [0.2s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ncdc_datasets.r:6:3): ncdc_datasets returns the correct class
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. vcr::use_cassette(...) test-ncdc_datasets.r:6:2
Β 3. rnoaa::ncdc_datasets() test-ncdc_datasets.r:7:4
Β 4. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datasets.r:50:2
Β 5. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Failure (test-ncdc_datasets.r:36:3): ncdc_datasets fails well
ncdc_datasets(datasetid = "ANNUAL")
threw an error with unexpected
message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Β 1. testthat::expect_error(ncdc_datasets(datasetid = "ANNUAL"),
"lexical error") test-ncdc_datasets.r:36:2
Β 6. rnoaa::ncdc_datasets(datasetid = "ANNUAL")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datasets.r:50:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
x | 2Β Β Β Β Β Β 0 | ncdc_datatypes [0.5s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error (test-ncdc_datatypes.r:6:3): ncdc_datatypes returns the correct class
Error in getOption("noaakey", stop("need an API key for NOAA data"))
:
need an API key for NOAA data
Backtrace:
Β 1. vcr::use_cassette(...) test-ncdc_datatypes.r:6:2
Β 3. rnoaa::ncdc_datatypes(datasetid = "ANNUAL") test-ncdc_datatypes.r:7:4
Β 4. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datatypes.r:54:2
Β 5. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Failure (test-ncdc_datatypes.r:30:3): ncdc_datatypes fails well
ncdc_datatypes(datasetid = "ANNUAL")
threw an error with unexpected
message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Β 1. testthat::expect_error(...) test-ncdc_datatypes.r:30:2
Β 6. rnoaa::ncdc_datatypes(datasetid = "ANNUAL")
Β 7. rnoaa::check_key(token)
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datatypes.r:54:2
Β 8. base::getOption("noaakey", stop("need an API key for NOAA data"))
/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Maximum number of failures exceeded; quitting at end of file.
Increase this number with (e.g.) Sys.setenv('TESTTHAT_MAX_FAILS' = Inf)
ββ Results ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Duration: 77.9 s
[ FAIL 10 | WARN 0 | SKIP 0 | PASS 259 ] ββ Terminated earl
Daniel,
Here is a run with Catalina, RStudio and R v4.x.Β Β The text files have the run log.Β the PNG shows the items wrote to Library/cache/R
Thanks for the instructions on setting up a test run.
R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
geetwd() Error in geetwd() : could not find function "geetwd" getwd() [1] "/Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa" devtools::test() βΉ Loading rnoaa Registered S3 method overwritten by 'httr': method from
print.cache_info hoardr βΉ Testing rnoaa β | F W S OK | Context β | 27 | arc2 [5.6s]
β | 21 | buoy [41.9s]
β | 1 | check_response_swdi
x | 3 0 | check_response [1.2s]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Failure (test-check_response.r:13:3): check_response works correctly on bad response content-typencdc(...)
threw an error with unexpected message. Expected match: "wrong response type, open an issue" Actual message: "need an API key for NOAA data" Backtrace:
- testthat::expect_error(...) test-check_response.r:13:2
- rnoaa::ncdc(...)
- rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc.r:191:2
- base::getOption("noaakey", stop("need an API key for NOAA data")) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2
Error (test-check_response.r:23:3): check_response returns an error
Error in getOption("noaakey", stop("need an API key for NOAA data"))
: need an API key for NOAA data
Backtrace:
Error (test-check_response.r:40:3): check_response returns the correct error messages
Error in getOption("noaakey", stop("need an API key for NOAA data"))
: need an API key for NOAA data
Backtrace:
getOption("noaakey", stop("need an API key for NOAA data"))
: need an API key for NOAA data
Backtrace:Failure (test-ncdc_datacats.r:36:3): ncdc_datacats fails well
ncdc_datacats(datacategoryid = "ANNAGR")
threw an error with unexpected message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
getOption("noaakey", stop("need an API key for NOAA data"))
: need an API key for NOAA data
Backtrace:Failure (test-ncdc_datasets.r:36:3): ncdc_datasets fails well
ncdc_datasets(datasetid = "ANNUAL")
threw an error with unexpected message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
getOption("noaakey", stop("need an API key for NOAA data"))
: need an API key for NOAA data
Backtrace:Failure (test-ncdc_datatypes.r:30:3): ncdc_datatypes fails well
ncdc_datatypes(datasetid = "ANNUAL")
threw an error with unexpected message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
getOption("noaakey", stop("need an API key for NOAA data"))
: need an API key for NOAA data
Backtrace:Failure (test-ncdc_locs_cats.r:43:3): ncdc_locs fails well
ncdc_locs_cats(startdate = "1970-01-01")
threw an error with unexpected message.
Expected match: "lexical error"
Actual message: "need an API key for NOAA data"
Backtrace:
Sys.setenv('TESTTHAT_MAX_FAILS' = Inf)
ββ Results ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Duration: 123.7 s
ββ Skipped tests βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β’ Skipping ncdc_legacy for now (1)
[ FAIL 11 | WARN 0 | SKIP 1 | PASS 268 ] ββ Terminated early βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The CRAN policy only allows writing in file areas via tools::R_user_dir() (which differ by OS). On macOS, ~/Library/Caches/R is not one of those, yet we see there
drwxr-xr-x 5 ripley staff 160 8 Nov 23:35 ftdoi/ drwxr-xr-x 6 ripley staff 192 8 Nov 23:35 fulltext_storr/ drwxr-xr-x 2 ripley staff 64 8 Nov 06:54 noaa_ersst/ drwxr-xr-x 4 ripley staff 128 8 Nov 06:54 rdryad/
from
fulltext (also suppdata via fulltext) ditto rnoaa mvSLOUCH via rdryad (which does not create this in its own checks).
respectively. NB: rappdirs does not comply with the policy.
This makes it much harder to sweep up after you.
These need to be corrected before 2021-11-23 to retain the package on CRAN.