ci: improve scripts for local development #188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I picked up this repo recently to work on while commuting, when I'm often offline. This PR implements some tidyups I found useful.
Support offline test running
Currently
cargo make test
will fail if you're offline, as it will always attempt to pull the remote docker image.This PR implements the environment variable
DOCKER_PULL_ATTEMPTS
to make this optional:DOCKER_PULL_ATTEMPTS=0 STACK_VERSION=7.14.0 cargo make test
Dump logs for shutdown/errored containers
My test elasticsearch instance failed to start (I was running an older version,
7.10.0
, which wasn't supported). This was opaque to debug as the container is instantly deleted on shutdown (docker run --rm
).This PR implements always dumping logging from the elasticsearch instance. It does this by not deleting the container automatically, and instead deleting it explicitly after dumping logs. Previous containers also deleted if found by the next test run.
Please note that the impact of this is that some containers may still be left from the test run on the user's system. I believe this is desirable anyway for inspection after failure.