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

Implement VCRReplaySearch modes: SearchAll, SkipFound #2

Merged
merged 1 commit into from
Apr 30, 2023

Conversation

mksh
Copy link
Contributor

@mksh mksh commented Apr 30, 2023

Initial implementation was always skipping records which were already found when replaying.

While this provides more strict testing approach, it is only suitable when requests are coming in a predefined order.
If some requests are started in parallel, responses can come in random order too, and so skipping requests
will break the tests.

This PR adds method .with_search(search_mode) and two search modes:

  • VCRReplaySearch::SkipFound -- skips found requests on subsequent replays, as default
  • VCRReplaySearch::SearchAll -- always goes through all requests and returns first match

Now, tests for parallel requests can work as long as all parallel requests are having different parameters, headers or urls.

@mksh mksh merged commit e83925d into main Apr 30, 2023
@mksh mksh deleted the dont-skip-requests branch April 30, 2023 11:18
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