Closed jsta closed 3 years ago
dir = vcr::vcr_test_path("fixtures")
-> dir = "../fixtures"
Thanks. Was going to send an email to people this morning. I did run revdep checks and didn't get any issues (and I don't personally use the function in my own http pkgs), but I should have emailed about this issue, sorry about that. Looking into it
👋🏻 My PR #230 probably caused this. Sorry for the trouble this is causing!
I can reproduce with https://github.com/ropensci/opencage/tree/devel. devtools::check()
/R CMD check apparently moves the test dir outside the pkg dir:
.
+-- 00check.log
+-- 00install.out
+-- 00_pkg_src
| \-- opencage
+-- opencage
| +-- data
| +-- DESCRIPTION
| +-- doc
| +-- extdata
| +-- help
| +-- html
| +-- INDEX
| +-- Meta
| +-- NAMESPACE
| +-- NEWS.md
| \-- R
+-- opencage-Ex.pdf
+-- opencage-Ex.R
+-- opencage-Ex.Rout
+-- opencage-Ex.timings
\-- tests
+-- startup.Rs
+-- testthat
+-- testthat.R
+-- testthat.Rout.fail
\-- vcr_cassettes
(vcr_cassettes
is what is usually called fixtures
)
I looking into ways how to catch this. Maybe rprojroot::has_dir("tests")
?
Using rprojroot::has_dir("tests")
in vcr_test_path()
seems to work in general, i.e. both devtools::test()
and devtools::check()
run successfully with this change on https://github.com/ropensci/opencage/tree/devel.
However, since has_dir()
is starting to look up the tests
dir from ./tests/testthat/
, it will use ./tests/testthat/tests/
or ./tests/tests/
as a "root" dir should those exist. The tests still run, though.
@dpprdan Thanks for the quick response
@jsta can you try again after installing the change @dpprdan made above remotes::install_github("dpprdan/vcr@2881b588fe3eabac2c7a371f199aaad407b7bddf")
(p.s. @dpprdan ultimately responsibility is with me as the lead maintainer, so no worries)
Thanks! Still sucks though to have this go to CRAN and causing revdeps to fail. Apparently I didn't run R CMD check on opencage since #230 got merged (or I didn't install that change locally?) or else I would have caught it. Strange.
Works with that fork!
All tests pass locally for me (running
devtools::test
) but fail running as part ofdevtools::check
. The error I get is the same as CRAN:I was able to pass check associated tests by removing the call to
vcr_test_path
in the autogenerated "setup" file and hardcoding the path to the fixtures directory.