Skip to content
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

Playback: Check outgoing traffic if it matches what is recorded in VCR tape + check if test source code changed + remove non-gzip vcr tape compat #8

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

megies
Copy link
Member

@megies megies commented Apr 3, 2017

This adds checking outgoing traffic during playback. This is sorely needed, otherwise code can be broken (e.g. sending malformed results), while VCR playback based tests pass (because incoming traffic is replayed not regarding if the request was valid).

This needs some mechanics to normalize actual/pre-recorded outgoing traffic before comparing the two. I'm open to suggestions for handling this differently as implemented right now.

This also introduces some exception classes.

No tests for this right now, but it works in real world ..

This now also adds the missing detail of making sure that test code (whether doctest examples or unittest test method) did not change from recording time to playback time. Otherwise the executed client side API calls might not match the VCR recording anymore.

megies added a commit to obspy/obspy that referenced this pull request Apr 3, 2017
@megies megies changed the title Playback: Check outgoing traffic if it matches what is recorded in VCR tape Playback: Check outgoing traffic if it matches what is recorded in VCR tape + check if test source code changed Apr 3, 2017
@megies megies changed the title Playback: Check outgoing traffic if it matches what is recorded in VCR tape + check if test source code changed Playback: Check outgoing traffic if it matches what is recorded in VCR tape + check if test source code changed + remove non-gzip vcr tape compat Apr 3, 2017
@megies
Copy link
Member Author

megies commented Apr 4, 2017

Handling of start/stop need cleaning up, I think. That's probably why this fails, although it has no vcr decorator: https://travis-ci.org/obspy/vcr/jobs/218428957#L462

Oh and yeah, I did not update vcr tapes yet.. will do later..

megies added a commit to obspy/obspy that referenced this pull request Apr 5, 2017
@megies
Copy link
Member Author

megies commented Apr 7, 2017

Ok, so since the context manager was added on master I will get rid of b602658 again and rebase on master..

@megies
Copy link
Member Author

megies commented Apr 7, 2017

Rebased on current master and force-pushed. Hope I didn't mess up, change to context manager made some conflict resolving necessary.. commit hash before rebase was 5a4b8ee.

@megies megies force-pushed the check_outgoing_traffic branch 2 times, most recently from 53cf697 to c5092f0 Compare April 7, 2017 13:42
@megies
Copy link
Member Author

megies commented Apr 7, 2017

Rebased and force-pushed.. tests should pass now hopefully ;-)

megies added a commit to obspy/obspy that referenced this pull request Apr 7, 2017
@megies
Copy link
Member Author

megies commented Apr 25, 2017

All but one test pass locally on Linux Python 3.6

@megies megies mentioned this pull request Jul 13, 2017
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant