-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.1.0 NewAsMode fails with ModeReplaying and missing cassette file #72
Comments
Hey @JVecsei , I've actually took the time to clean up the package structure a bit and moved Could you please test out Please pay attention that you also need to update your package imports to use the new package URL. Let me know how it goes. Thanks! |
Hey @dnaeon, thanks for the quick response & fix! These lines though still cause trouble on our side: Lines 207 to 214 in c444037
Before it was just working when passing in |
Ah, I see now. I was under the impression that the default mode of operation was causing the issue for you. I've overlooked that detail :) I do think that for While the previous behaviour of Is it possible for you to switch to either |
Thanks again for your quick feedback! Since Thanks for your help! |
Hey @JVecsei , I'm working on a I've decided to spend some time cleaning up the API, fixing the tests and add a few new features to the cassettes, which would allow for more options when creating new filters, etc. Please check the current I believe what you are looking for is the Please check it out and let me know if that's what you need. I'm planning to release |
Hey @JVecsei , just tagged Please test it out and let me know if you find any issues. I'll close this one out, as I think your use case should be covered by the default mode of the recorder. Feel free to re-open if that's not the case. |
@dnaeon , thank you again for your help and addressing that topic. That is exactly what we are looking for! Before it was actually exposing that by overwriting the internal mode Lines 216 to 218 in c444037
Would it be possible by e.g. exposing the Lines 223 to 226 in 4015d92
Something like Just as an information why this can be interesting: We do certain cleanup steps only in case a recording was done. In case we are replaying a recording, we don't want to execute these cleanup steps. I'm sure this will be useful for other users too. Thanks again 👍 |
The latest minor version update contained a breaking change in the
NewAsMode
function.go-vcr/v2/recorder/recorder.go
Lines 193 to 198 in 6bd2f2d
In the previous version we were using (
v.2.0.1
), this function just created an empty cassette if there was no cassette file found with the given name. Withv2.1.0
this behavior changed and callingNewAsMode
usingModeReplaying
in combination with a non-existing cassette filename returns an error.Especially in test scenarios where the recorder is just setup in a
SetupTest
method for all tests, independent of whether all test methods execute an outgoing http call, this is an undesired behavior.Could we get this function backwards compatible by introducing a flag which defines whether a missing cassette file should return an error?
Thanks in advance!
The text was updated successfully, but these errors were encountered: