Conversation
feat: httr to httr2
|
I pushed changes to R-CMD-orig.yaml so it succeeds with and without API key access:
I think someone with API key access could push something to trigger fully-live testing after a PR by someone without API key access. Here are two runs in my repo, with API key access and a rerun of those jobs after deleting the API key R-CMD-check.yaml should do the same things here unless I'm overlooking something. Hopefully that's the CI builds rework we need! |
|
Thanks for the follow up. Question for you, can we arrange some kind of simple toggle for running all tests locally where we ignore the VCR recordings? I can get that kind of functionality by putting
Thoughts? |
We can flip the environment check so it skips those tests when an environmental variable is set. That's the way @JamesHWade submitted it but I suggested he flip it. Local testing would be faster then as it's unlikely a bug would be fixed when running the tests repeatedly during developmnet.
We'll have to add back
It's the presence of a recorded file that triggers a non-live test. I have the ubuntu job deleting all the recordings when the API key is available so all tests are live. The ubuntu job is currently checking in the recordings but it wouldn't have to do that if the other two jobs are running live. |
Can we treat all tests, whether they are for the test-api-bugs.R file or else wise, the same? In other words, can we remove anything that distinguishes between tests that are in that file vs not? Stated more to the point, what is the purpose of having that file be tested separate than the others?
Cool, can we do this?
Great, so no need to change anything as it relates to testing on CI then, as the vcr files aren't checked in |
We can. I think James was trying to separate out the bug testing for speed. It's a bit backwards, the tests fail when bugs are fixed (making the use of a recorded test a bit strange). Without an environmental variable you're running live bug tests as you develop something. It's highly unlikely that an API bug would go away (like if you are running tests every 10 minutes). test-api-bugs.R isn't looking for recordings but it could so local bug testing wouldn't necessarily run live all the time. Or we could get rid of test-api-bugs.R all together.
Sure, but the vcr doc explicitly mentions that it can be used to run on CRAN
They are currently checked in. We'd need to delete them and add them to .gitignore if that's what you want. I was trying to have builds run with and without API key access but that won't be possible w/o checking in the recordings. The thought was builds triggered by PRs would work with recorded tests. I think if you then push something to the PR , the jobs would run live (running as you), getting us close to the original API builds (when there wasn't an API key). In the previous PR we thought you could rerun the failed jobs but that seems to be wrong (they run as the original actor, not as you). If this isn't what you want, the recordings would still be useful locally. |
|
In the latest push:
|
|
Hi Russ, sorry for the delay. I think I bungled that last review, apologies. Things looked good when I reviewed, though, certainly good enough to merge. If you're happy with things, let's merge and push to CRAN (assuming the current version of the API is stable). |
|
Let me do one more push, I noticed I hadn't run pkgdown::build_articles() or pkgdown::build_reference().
It is they, haven't made changes since mid-December. It would be great to be back on CRAN! |
|
I'm ready to merge, I just did a push to update the html files. There is an unindexed possible tech note we could delete if you'd like. I would like to submit it when were back on CRAN. I don't think many people are using the new version of the API (based on the inactivity in the forum) |
|
Great, looks good! |
This PR aligns the package with the latest release of the Patentsview API. It also incorporates changes from mustberuss#3 by @JamesHWade to improve test performance and documentation.
Changes
Test infrastructure
TL;DR Workflows (fully below)
pull_request, notpull_request_target)if actor has access to API key, rerecord cassettes, run the dont_run examples and run live API bug tests
otherwise run recorded tests without live API bug tests and dont_run examples are not run
API bug work arounds
Paging broke with the November API release and was not fixed in the December release. The API may now return dissimilar pages of data, breaking the
rbind(). Now we remove unrequested fields to try to help therbind()succeed but it can still fail (see "Paging structure mismatch bug" in test-api-bugs.R and/or its reprex).Vignettes
Documentation