pact-mock_service icon indicating copy to clipboard operation
pact-mock_service copied to clipboard

fail-fast on missing --pact_dir parameter

Open timoreimann opened this issue 10 years ago • 2 comments
trafficstars

If one does not pass the --pact_dir parameter the mock service, it only fails when the first interaction has succeeded, i.e., when the service wants to persist the generated Pact file.

IMHO, the service should already check whether the parameter has been passed on startup so that users receive an indication early enough. This is especially important in high-volume CI environments where extensive test suites should not even need to start if the mock service hasn't started successfully.

timoreimann avatar Sep 14 '15 16:09 timoreimann

The reason it's a late failure is that in the original code, the pact directory was sent through with the request, not at startup, so it was not possible to fail until that first request had come though. I'm pretty sure we can change it now, as I expect the older versions of that code are not in use. I would give it a default directory (probably "./pacts") rather than making it mandatory however.

bethesque avatar Sep 15 '15 02:09 bethesque

Default directory sounds good. It'd even allow old versions to transition to new ones smoothly.

timoreimann avatar Sep 15 '15 12:09 timoreimann