I'm using imposter in my end to end test setup via Docker Compose. Since the application to test depends on making requests to the mocked service quite early, I'd like to start it only when the mock server is up and ready.
In Docker Compose files, you can do this by adding a healthcheck condition to the service and then depend on the service_healthy status in the depends_on declaration:
healthcheck:
test: ["CMD-SHELL", "curl -f http://imposter:8080 || exit 1"]
interval: 5s
timeout: 5s
retries: 10
I have two questions:
- The command given in
test is executed inside the container, so any tool to do the actual health check must be in the container. Since the container is quite locked down, I haven't found anything I could use for this purpose. Would you be open to adding a CLI option to the server to check if its up and ready?
- If not, is there a good route to query for readiness? I haven't seen the classic
/health endpoint.
I'm using imposter in my end to end test setup via Docker Compose. Since the application to test depends on making requests to the mocked service quite early, I'd like to start it only when the mock server is up and ready.
In Docker Compose files, you can do this by adding a
healthcheckcondition to the service and then depend on theservice_healthystatus in thedepends_ondeclaration:I have two questions:
testis executed inside the container, so any tool to do the actual health check must be in the container. Since the container is quite locked down, I haven't found anything I could use for this purpose. Would you be open to adding a CLI option to the server to check if its up and ready?/healthendpoint.