ropensci / rnoaa

R interface to many NOAA data APIs
https://docs.ropensci.org/rnoaa
Other
328 stars 85 forks source link

change to appease cran #403

Closed sckott closed 2 years ago

sckott commented 2 years ago

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.

djhocking commented 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).

sckott commented 2 years ago

πŸ‘πŸ½

djhocking commented 2 years ago

Success, update now on CRAN

djhocking commented 2 years ago

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.

sckott commented 2 years ago

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

kjschaudt commented 2 years ago

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.

djhocking commented 2 years ago

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

kjschaudt commented 2 years ago

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.

djhocking commented 2 years ago

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!

kjschaudt commented 2 years ago

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.

kjschaudt commented 2 years ago

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.

kjschaudt commented 2 years ago

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.

djhocking commented 2 years ago

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")
kjschaudt commented 2 years ago

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.

djhocking commented 2 years ago

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")
kjschaudt commented 2 years ago

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.

kjschaudt commented 2 years ago

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")

djhocking commented 2 years ago

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.

kjschaudt commented 2 years ago

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’

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.

djhocking commented 2 years ago

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.

kjschaudt commented 2 years ago

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

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.

β€” 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.

kjschaudt commented 2 years ago

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’

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/credentials_1.3.1.tgz' Content type 'application/x-gzip' length 171560 bytes (167 KB)

downloaded 167 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/gitcreds_0.1.1.tgz' Content type 'application/x-gzip' length 91981 bytes (89 KB)

downloaded 89 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/ini_0.3.1.tgz' Content type 'application/x-gzip' length 13224 bytes (12 KB)

downloaded 12 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/gert_1.4.3.tgz' Content type 'application/x-gzip' length 2084590 bytes (2.0 MB)

downloaded 2.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/gh_1.3.0.tgz' Content type 'application/x-gzip' length 137863 bytes (134 KB)

downloaded 134 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/whisker_0.4.tgz' Content type 'application/x-gzip' length 65505 bytes (63 KB)

downloaded 63 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/xopen_1.0.0.tgz' Content type 'application/x-gzip' length 22444 bytes (21 KB)

downloaded 21 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/brew_1.0-6.tgz' Content type 'application/x-gzip' length 106877 bytes (104 KB)

downloaded 104 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/commonmark_1.7.tgz' Content type 'application/x-gzip' length 310444 bytes (303 KB)

downloaded 303 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/usethis_2.1.3.tgz' Content type 'application/x-gzip' length 769517 bytes (751 KB)

downloaded 751 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/pkgbuild_1.2.0.tgz' Content type 'application/x-gzip' length 140834 bytes (137 KB)

downloaded 137 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/rcmdcheck_1.4.0.tgz' Content type 'application/x-gzip' length 168344 bytes (164 KB)

downloaded 164 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/roxygen2_7.1.2.tgz' Content type 'application/x-gzip' length 859689 bytes (839 KB)

downloaded 839 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/rversions_2.1.1.tgz' Content type 'application/x-gzip' length 64526 bytes (63 KB)

downloaded 63 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/sessioninfo_1.2.1.tgz' Content type 'application/x-gzip' length 185408 bytes (181 KB)

downloaded 181 KB

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

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/mockery_0.4.2.tgz' Content type 'application/x-gzip' length 39570 bytes (38 KB)

downloaded 38 KB

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//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]

Enter one or more numbers, or an empty line to skip updates: 1 cpp11Β Β Β Β  (0.4.0 -> 0.4.1Β Β  ) [CRAN] glueΒ Β Β Β Β  (1.4.2 -> 1.5.0Β Β  ) [CRAN] tibbleΒ Β Β  (3.1.5 -> 3.1.6Β Β  ) [CRAN] triebeard (NAΒ Β Β  -> 0.3.0Β Β  ) [CRAN] rjsonΒ Β Β Β  (NAΒ Β Β  -> 0.2.20Β  ) [CRAN] httpcodeΒ  (NAΒ Β Β  -> 0.3.0Β Β  ) [CRAN] urltoolsΒ  (NAΒ Β Β  -> 1.7.3Β Β  ) [CRAN] hoardrΒ Β Β  (NAΒ Β Β  -> 0.5.2Β Β  ) [CRAN] geonamesΒ  (NAΒ Β Β  -> 0.999Β Β  ) [CRAN] isdparser (NAΒ Β Β  -> 0.4.0Β Β  ) [CRAN] XMLΒ Β Β Β Β Β  (NAΒ Β Β  -> 3.99-0.8) [CRAN] crulΒ Β Β Β Β  (NAΒ Β Β  -> 1.2.0Β Β  ) [CRAN] Installing 12 packages: cpp11, glue, tibble, triebeard, rjson, httpcode, urltools, hoardr, geonames, isdparser, XML, crul trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/cpp11_0.4.1.tgz' Content type 'application/x-gzip' length 304412 bytes (297 KB)

downloaded 297 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/glue_1.5.0.tgz' Content type 'application/x-gzip' length 145947 bytes (142 KB)

downloaded 142 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/tibble_3.1.6.tgz' Content type 'application/x-gzip' length 846646 bytes (826 KB)

downloaded 826 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/triebeard_0.3.0.tgz' Content type 'application/x-gzip' length 1040138 bytes (1015 KB)

downloaded 1015 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/rjson_0.2.20.tgz' Content type 'application/x-gzip' length 191694 bytes (187 KB)

downloaded 187 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/httpcode_0.3.0.tgz' Content type 'application/x-gzip' length 32388 bytes (31 KB)

downloaded 31 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/urltools_1.7.3.tgz' Content type 'application/x-gzip' length 957803 bytes (935 KB)

downloaded 935 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/hoardr_0.5.2.tgz' Content type 'application/x-gzip' length 359282 bytes (350 KB)

downloaded 350 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/geonames_0.999.tgz' Content type 'application/x-gzip' length 63398 bytes (61 KB)

downloaded 61 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/isdparser_0.4.0.tgz' Content type 'application/x-gzip' length 775504 bytes (757 KB)

downloaded 757 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/XML_3.99-0.8.tgz' Content type 'application/x-gzip' length 3742478 bytes (3.6 MB)

downloaded 3.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/crul_1.2.0.tgz' Content type 'application/x-gzip' length 639567 bytes (624 KB)

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’

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

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.

β€” 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.

kjschaudt commented 2 years ago

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

djhocking commented 2 years ago

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

  1. Got to GitHub: https://github.com/ropensci/rnoaa and click Fork to create a copy of the full repository associated with your GitHub account.
  2. Clone that repository to your local machine. You can use the CL 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.
  3. At this point, you are ready for full development of the package and can run devtools::test() and all the other devtools functions on this package to create things and test them on your local machine. 4.The R Package Git Book by Hadley Wickham and Jenny Bryan is the best source for starting developing and working with packages, including getting started with testing using the testthat package: https://r-pkgs.org/
kjschaudt commented 2 years ago

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

kjschaudt commented 2 years ago

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-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
  2. rnoaa::ncdc(...)
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc.r:191:2
  4. 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
  2. rnoaa::ncdc_locs_cats(startdate = "2100-01-01")
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
  4. 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
  2. rnoaa::ncdc_locs_cats(startdate = "2100-01-01")
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
  4. 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.5s]
    βœ“ | 31 | cpc_prcp [0.9s]
    βœ“ | 8 | defunct
    βœ“ | 9 | ersst [1.5s]
    βœ“ | 11 | ghcnd_splitvars [3.1s]
    βœ“ | 50 | ghcnd [18.1s]
    βœ“ | 16 | homr [1.7s]
    βœ“ | 8 | isd_read [7.6s]
    βœ“ | 45 | isd_stations [1.7s]
    βœ“ | 5 | isd [17.6s]
    βœ“ | 14 | lcd [3.3s]
    βœ“ | 10 | meteo [16.5s]
    x | 2 0 | ncdc_datacats [0.6s]
    ───────────────────────────────────────────────────────────────────────────────── 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:
  5. vcr::use_cassette(...) test-ncdc_datacats.r:6:2
  6. rnoaa::ncdc_datacats() test-ncdc_datacats.r:7:4
  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

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
  2. rnoaa::ncdc_datacats(datacategoryid = "ANNAGR")
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datacats.r:46:2
  4. 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:
  5. vcr::use_cassette(...) test-ncdc_datasets.r:6:2
  6. rnoaa::ncdc_datasets() test-ncdc_datasets.r:7:4
  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

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
  2. rnoaa::ncdc_datasets(datasetid = "ANNUAL")
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datasets.r:50:2
  4. 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.2s]
    ───────────────────────────────────────────────────────────────────────────────── 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:
  5. vcr::use_cassette(...) test-ncdc_datatypes.r:6:2
  6. rnoaa::ncdc_datatypes(datasetid = "ANNUAL") test-ncdc_datatypes.r:7:4
  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

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
  2. rnoaa::ncdc_datatypes(datasetid = "ANNUAL")
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_datatypes.r:54:2
  4. base::getOption("noaakey", stop("need an API key for NOAA data")) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/zzz.r:212:2 ───────────────────────────────────────────────────────────────────────────────── βœ“ | 1 0 | ncdc_legacy
    ───────────────────────────────────────────────────────────────────────────────── Skip (test-ncdc_legacy.R:4:3): basic functionality works Reason: Skipping ncdc_legacy for now ───────────────────────────────────────────────────────────────────────────────── x | 2 0 | ncdc_locs_cats [0.1s]
    ───────────────────────────────────────────────────────────────────────────────── Error (test-ncdc_locs_cats.r:6:3): ncdc_locs_cats returns the correct ... Error in getOption("noaakey", stop("need an API key for NOAA data")): need an API key for NOAA data Backtrace:
  5. vcr::use_cassette(...) test-ncdc_locs_cats.r:6:2
  6. rnoaa::ncdc_locs_cats() test-ncdc_locs_cats.r:7:4
  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

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:

  1. testthat::expect_error(...) test-ncdc_locs_cats.r:43:2
  2. rnoaa::ncdc_locs_cats(startdate = "1970-01-01")
  3. rnoaa::check_key(token) /Volumes/SG8GB/Users/schaudt/R_Projects/rnoaa/R/ncdc_locs_cats.r:38:2
  4. 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: 123.7 s

── Skipped tests ─────────────────────────────────────────────────────────────── β€’ Skipping ncdc_legacy for now (1)

[ FAIL 11 | WARN 0 | SKIP 1 | PASS 268 ] ══ Terminated early ═════════════════════════════════════════════════════════════