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

RPF: Configure DVR to re-record existing tests #906

Closed
tjprescott opened this issue Jun 14, 2021 · 3 comments
Closed

RPF: Configure DVR to re-record existing tests #906

tjprescott opened this issue Jun 14, 2021 · 3 comments
Assignees

Comments

@tjprescott
Copy link
Member

DVR concurrently looks to see if a recording exists, and if it does, it will consider itself in playback mode. We would prefer to explicitly call out whether we want DVR to record.

Modes:

  • record: record tests or, if they already exist, re-record them
  • playback: playback tests if they exist; if not, fail

This should honor the TEST_MODE environment variable we are setting.

@tjprescott
Copy link
Member Author

tjprescott commented Jun 15, 2021

Here's the link to the VCRpy record modes:
https://vcrpy.readthedocs.io/en/latest/usage.html#record-modes

  • once
    • Replay previously recorded interactions.
    • Record new interactions if there is no cassette file.
    • Cause an error to be raised for new requests if there is a cassette file.

once is the default record mode, used when you do not set one.

  • new_episodes

    • Record new interactions.
    • Replay previously recorded interactions. It is similar to the once record mode, but will always record new interactions, even if you have an existing recorded one that is similar, but not identical.
  • none

    • Replay previously recorded interactions.
    • Cause an error to be raised for any new requests. This is useful when your code makes potentially dangerous HTTP requests. The none record mode guarantees that no new HTTP requests will be made.
  • all

    • Record new interactions.
    • Never replay previously recorded interactions. This can be temporarily used to force VCR to re-record a cassette (i.e. to ensure
      the responses are not out of date) or can be used when you simply want to log all HTTP requests.

@tjprescott
Copy link
Member Author

Essentially:

  • Record mode => DVR .all
  • Playback mode=> DVR .none
  • Live => Use URLSession instead of DVR's Session type

@tjprescott
Copy link
Member Author

PR #909 merged. Closing.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants