-
Notifications
You must be signed in to change notification settings - Fork 364
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
Use php-vcr to record http interactions through all the test suite #987
Merged
c9s
merged 2 commits into
phpbrew:master
from
kevinnio:use-vcr-to-record-http-interactions
Feb 28, 2019
Merged
Use php-vcr to record http interactions through all the test suite #987
c9s
merged 2 commits into
phpbrew:master
from
kevinnio:use-vcr-to-record-http-interactions
Feb 28, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a09017e
to
aa1bf96
Compare
6fc0112
to
0f88b85
Compare
@c9s, if you can take a look when you've got free time, I'd appreciate it. |
c9s
reviewed
Jan 20, 2019
This is an attempt to wrap every http interaction done while testing in a VCR cassette. Not every single interaction can be wrapped since some of them download binary files (which can't be stored in cassettes), but this commit wraps every interaction that can be wrapped. This will allow for faster tests and less problems related to hitting API limits, triggering anti-DDoS tools and such. This also introduces two new phpunit group tags: cantVCR and macosIncompatible. The first one is meant to be used in every test which by its own nature cannot be wrapped into a VCR cassette. These are, for example, tests where binary files are downloaded. The latter is just a treat to allow devs who use macOS to run the test suite without tests breaking due to system libraries not available on that OS. Now we can run something like vendor/bin/phpunit --exclude-group cantVCR whenever we want to run the test suite without hitting the network. We can always do a full run when needed.
da7689e
to
04df0fa
Compare
looks like travis-ci did not run |
c9s
approved these changes
Jan 26, 2019
04df0fa
to
2ad2ce2
Compare
Travis build fixed. Ready to merge whenever you are, @c9s. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to wrap every http interaction done while testing in a VCR cassette. This is a followup to #986.
Not every single interaction can be wrapped since some of them download binary files (which can't be stored in cassettes), but this PR wraps alls interactions that can be wrapped. This will allow for faster builds and less problems related to hitting API limits, triggering anti-DDoS tools and such.
This also introduces two new phpunit group tags:
noVCR
andmacosIncompatible
. The first one is meant to be used in every test which by its own nature cannot be wrapped into a VCR cassette. These are, for example, tests where binary files are downloaded. The latter is just a treat to allow devs who use macOS to run the test suite without tests breaking due to system libraries not available on that OS.Now we can run something like
vendor/bin/phpunit --exclude-group noVCR
whenever we want to run the test suite without hitting the network. We can always do a full run when needed (while in Travis, for example).Maybe later we can figure out a way to prevent any test from actually reaching out to the Internet, but I think this is generally a step in a good direction for the project.