Skip to content
Merged
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
10 changes: 8 additions & 2 deletions tests/e2e_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,21 @@ def docker_runner(params):
"""Starts a Docker container before tests and gracefully terminates it after."""

def is_docker_running():
"""Check if Docker has been run."""
"""Check if Docker is running and optionally skip pulling the image."""
try:
subprocess.run(
["docker", "info"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=True,
)
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)

skip_pull = os.getenv("SKIP_PULL", "0") == "1"
if not skip_pull:
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
else:
print(f"[SKIP_PULL=1] Skipping 'docker pull {LOCALNET_IMAGE_NAME}'")

return True
except subprocess.CalledProcessError:
return False
Expand Down
Loading