We develop client libraries in numerous languages and would like to have server record/replay support across all our testing. Our scenarios are that third party contributors are able to download and test against recordings without incurring the cost of testing against our service as well as better support for GitHub Continuous Integration, which works better if running tests does not require any network requests. Ideally, we’d be able to have our test suites invoke this proxy in another process with some configurations and then have our tests run through the proxy and then shut down the proxy when our tests complete.
I have played with the proxy (and mitmdump, which seems more appropriate for our large scale usage) and looked at the docs, but I have had some difficulty determining if we would actually be able to meet all of our requirements and, beyond that, how to set it up and which options and commands to use to do so. Our requirements for this use case are as follows:
- Ability to record client requests and server responses
- Ability to run in replay mode in which client requests are matched to a recorded flow and the serve response is replayed
- Ability to run all tests in replay mode sequentially (no need for concurrency, but we shouldn’t have to individually play every test)
- Ability to save the flows from each test in their own files
- Ability to ignore certain headers when matching, such as date headers which will always be obsolete
- Ability to scrub sensitive information like Authorization headers and account names in a way that does not interfere with flow matching. This could be in the form of some callback which is called to scrub right before recording and right before matching. Something to that effect.
If you guys have any insight on how to get started with all of this, that would be really appreciated. Thank you so much!