ReadOnly mode
Expected behaviour
I would like a way to:
- hydrate the mountebank imposters data stored externally
- start an ephemeral mountebank server (i.e. one that exists for the duration of a CI build)
- guarantee that proxies don't hit the network
The broader context here is that I would like to have separate jobs for generating mocks and consuming them. The mock generation will use proxyOnce and persist the mocks somewhere. Then, test runs will download and hydrate these mocks. I would like to have confidence that the test runs are in fact using the mocks. To accomplish this, I want the mock server to only return persisted mocks, and not pass any requests through to the proxied server in this mode.
Actual behaviour
- Using
--datadirresults in a PUT when the server is turned on, which erases all the old values. - There is no easy way to guarantee that proxies aren't being used.
Steps to reproduce
- Start a new server that proxies requests and uses a datadir
- Pass some requests to that server
- Restart the server
- Observe as the imposters have been deleted
Software versions used
OS : OSX 11.6
mountebank : 2.5.0
node.js : v14.18.1
Installation method : npm
Hi there,
I realize it's a two step process, but it seems to me that mb replay do the trick for you. See http://www.mbtest.org/docs/commandLine#replay
So the idea, on the second job, to do an mb start followed by an mb replay.