Skip to content

Commit

Permalink
Merge pull request #1141 from dandi/gh-1140
Browse files Browse the repository at this point in the history
Add `DANDI_TESTS_PULL_DOCKER_COMPOSE` envvar
  • Loading branch information
yarikoptic authored Oct 21, 2022
2 parents 26fa719 + 18edf40 commit 4c4fa5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ development command line options.
new set on each run. Set this environment variable to `0` to cause the
containers to be destroyed at the end of the next run.

- `DANDI_TESTS_PULL_DOCKER_COMPOSE` -- When set to an empty string or `0`, the
tests will not pull the latest needed Docker images at the start of a run if
older versions of the images are already present.

## Sourcegraph

The [Sourcegraph](https://sourcegraph.com) browser extension can be used to
Expand Down
3 changes: 2 additions & 1 deletion dandi/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ def docker_compose_setup() -> Iterator[Dict[str, str]]:
env = {**os.environ, "DJANGO_DANDI_SCHEMA_VERSION": DANDI_SCHEMA_VERSION}
try:
if create:
run(["docker-compose", "pull"], cwd=str(LOCAL_DOCKER_DIR), check=True)
if os.environ.get("DANDI_TESTS_PULL_DOCKER_COMPOSE", "1") not in ("", "0"):
run(["docker-compose", "pull"], cwd=str(LOCAL_DOCKER_DIR), check=True)
run(
["docker-compose", "run", "--rm", "django", "./manage.py", "migrate"],
cwd=str(LOCAL_DOCKER_DIR),
Expand Down

0 comments on commit 4c4fa5f

Please sign in to comment.