[LRUG] VCR caches
Mark Burns
markthedeveloper at gmail.com
Tue Sep 18 20:29:06 PDT 2018
>
> (just reviewing I think we're mainly recording interactions with 3rd
> party services such as stripe, pivotaltracker, codeclimate and github).
>
> These are exactly the kinds of tests that you should be able to draw a
line in the stack trace beyond which you stop testing and start trusting.
Presumably you’re using a gem for this. As soon as you enter that library
code is the point at which it makes sense to stub or mock.
Your business has already implicitly chosen to trust these services and
gems.
I’d say you gain little extra confidence from recording and replaying those
interactions for every integration test.
Now if you _did_ want to be more cautious, you could always have some tests
that test the specific integration and occasionally update the cassettes.
But most of the time you’d be repeating tests that should exist inside the
gem test suite. And it’s literally not your business to be doing that.
Unless you wrote the gem. But even then the tests should live together and
not be repeated all over the test suite for unrelated tests.
It’s probably only an approach I’d advise if I didn’t trust the third party
and still I would want localised tests for the specific integration.
But if it were the case that I didn’t trust the gem’s own test suites, I
probably wouldn’t have recommended using them anyway.
> What's unclear is how much the more "realistic" acceptance tests have ever
> bought us (nothing? a little? a lot?), compared to the trouble it creates
> for new developers trying to manage the VCR caches ...
>
I’d guess close to nothing, but costing a lot.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20180919/b838c9c2/attachment-0004.html>
More information about the Chat
mailing list