Open sckott opened 4 years ago
I definitely see the utility and I love how your implementation leverages the cli package.
I'm wondering if we need a wholly new function for this since cassettes()
already gets us pretty close:
> cassettes()
# $`create-dir-with-dot-prefix`
# <cassette>
# Recorded at: 2020-01-29 23:28:09 GMT
# Recorded with: vcr/0.4.1.93.9000, webmockr/0.5.1.96
#
# $`create-dir`
# <cassette>
# Recorded at: 2020-01-29 23:27:59 GMT
# Recorded with: vcr/0.4.1.93.9000, webmockr/0.5.1.96
#
# $`create-dir1`
# <cassette>
# Recorded at: 2020-01-29 23:27:23 GMT
# Recorded with: vcr/0.4.1.93.9000, webmockr/0.5.1.96
Perhaps recorded_with()
could be built on some of those existing helper functions.
good catch! totally forgot about that fxn. i'll see about leveraging cassettes()
instead ...
Sort of relates to our previous discussion re cassette helpers and cassette_files()
vs vcr_files()
.
What do you think about adding something like list_cassettes()
(the vcr equivalent of list.files()
), that just returns a vector of filepaths for (true-positive) cassettes in vcr_c$dir
?
My sense is it might be useful enough to export and could then be used internally by other functions like recorded_with()
.
a list_casettes
function sounds good. would be nice if it could collect which vcr/webmockr version, and cassette names used in each file too - then recorded_with
can use that output
vector of filepaths for (true-positive) cassettes
what does true-positive mean?
what does true-positive mean?
I just meant it should filter out non-cassette files (false positives), which will probably require reading the first line and checking for http_interactions
. Currently, cassettes()
gives me
$appveyor
list()
$codecov
list()
would be nice if it could collect which vcr/webmockr version, and cassette names used in each file too
Maybe the output should be more inline with fs::file_info()
: a data.frame
with one row per cassette that includes columns for file path, modification date, vcr/webmockr version, etc.
Or that could be second helper function that builds on list_cassettes()
? cassette_info()
?
okay, agree on true thing.
right, cassettes()
currently doesn't do what you'd expect when run from the root of a repo - we need to fix that so it figures out where the cassettes are stored and then can do the right thing. (Lets open an issue for this)
Yes, sounds good to have a data.frame like fs::file_info
makes
In going through the process of submitting a new version of a package that uses vcr, i was re-recording cassettes with the newest vcr and webmockr versions on cran. And i thought it would be easier if I could tell what fixtures had been recorded with old versions of webmockr/vcr
a draft function
gives (with some lines removed for brevity)
screenshot in brief for some color
thoughts @maelle @aaronwolen ?