Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DANDI_TESTS_PULL_DOCKER_COMPOSE envvar #1141

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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