Skip to content

Use php-vcr to record http interactions#986

Merged
c9s merged 2 commits into
phpbrew:masterfrom
kevinnio:use-vcr-to-record-http-interactions
Oct 28, 2018
Merged

Use php-vcr to record http interactions#986
c9s merged 2 commits into
phpbrew:masterfrom
kevinnio:use-vcr-to-record-http-interactions

Conversation

@kevinnio

@kevinnio kevinnio commented Oct 28, 2018

Copy link
Copy Markdown
Contributor

While submitting #985, I noticed my Travis build kept failing due to API limits while running tests for the KnownCommand class.

This introduces php-vcr to the project, which allows to record http interactions and reproduce them during tests, thus avoiding the need to actually hit the API. This will solve any API limit issue from now on. Cassettes only need to be updated if the real APIs change.

This PR only makes use of php-vcr in KnownCommandTest since that's where I noticed most builds fail. If this PR gets accepted, we can start working towards using php-vcr for all http interactions in the project's tests.

More info on php-vcr at http://php-vcr.github.io.

This installs php-vcr into the project. php-vcr is a port of a popular ruby gem
that allows to record and reproduce http interactions, thus avoiding the need to
actually hit web services during tests.

More info at http://php-vcr.github.io
@kevinnio kevinnio changed the title Use vcr to record http interactions Use php-vcr to record http interactions Oct 28, 2018
This uses php-vcr to record http interactions during the execution of KnowCommandTest,
avoiding the need to actually hit the Pecl, GitHub and BitBucket's API.
@kevinnio kevinnio force-pushed the use-vcr-to-record-http-interactions branch from 22799b4 to 254b6f5 Compare October 28, 2018 05:27
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.8%) to 52.515% when pulling 254b6f5 on kevinnio:use-vcr-to-record-http-interactions into ce35a8b on phpbrew:master.

2 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.8%) to 52.515% when pulling 254b6f5 on kevinnio:use-vcr-to-record-http-interactions into ce35a8b on phpbrew:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.8%) to 52.515% when pulling 254b6f5 on kevinnio:use-vcr-to-record-http-interactions into ce35a8b on phpbrew:master.

@c9s

c9s commented Oct 28, 2018

Copy link
Copy Markdown
Member

Looks good, thanks.

@c9s c9s merged commit 2507336 into phpbrew:master Oct 28, 2018
@kevinnio kevinnio deleted the use-vcr-to-record-http-interactions branch October 29, 2018 16:02
@kevinnio

Copy link
Copy Markdown
Contributor Author

Thanks, @c9s. I'll push another PR wrapping all http interactions in the tests with php-vcr asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants