-
Notifications
You must be signed in to change notification settings - Fork 26
Add Health Check in Pact Interactions, Don't setup until Pact is available #32
Comments
So, this approach shouldn't be needed any more if we can take advantage of a new feature in pact-mock-service. If you call:
this will block until the service is healthy. To stop, call
This also removes the need to manage pids. I had a go at trying to convert gulp to use this, but my gulp is not good enough. |
What you've done is good, but I'm not certain if this will fix all edge cases. What if they don't use bundler? What about if Pact is on another machine that they're pointing to? What if they're build process actually doesn't even wait for the process to return anything and just goes onto the next step? What happens if they're using gulp and the pact-mock-service start is in parallel with the tests? I think all of these are very valid reason as to why we should have a health check and a 'block' on http requests until the health check is satisfied. |
Good points. I'm happy for this to be added as a feature. |
There's now a PUT /interactions endpoint that means that we don't have to do the messy sequential DELETE, POST /interaction, POST /interaction... it will do it all in one go. I'd like to get that in next, before we modify the code to wait, as it will make the code much cleaner. |
Sounds good. Let me know when ready. |
Had a few minutes waiting for a deploy, did the PUT change. |
Since we spoke about the healthcheck earlier, I am actually doing something similar in my build process to see when pact is available. I check every second until something is returned from the service.
Maybe this is something that should be included in the dsl to help people. At the very least, have the health check interaction under Pact.Interactions so that it can called easily.
The text was updated successfully, but these errors were encountered: