Skip to content

Commit 5a78b9d

Browse files
author
Roman
committed
add SKIP_PULL variable for conftest.py
1 parent 13cf19a commit 5a78b9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/e2e_tests/conftest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,21 @@ def docker_runner(params):
129129
"""Starts a Docker container before tests and gracefully terminates it after."""
130130

131131
def is_docker_running():
132-
"""Check if Docker has been run."""
132+
"""Check if Docker is running and optionally skip pulling the image."""
133133
try:
134134
subprocess.run(
135135
["docker", "info"],
136136
stdout=subprocess.DEVNULL,
137137
stderr=subprocess.DEVNULL,
138138
check=True,
139139
)
140-
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
140+
141+
skip_pull = os.getenv("SKIP_PULL", "0") == "1"
142+
if not skip_pull:
143+
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
144+
else:
145+
print(f"[SKIP_PULL=1] Skipping 'docker pull {LOCALNET_IMAGE_NAME}'")
146+
141147
return True
142148
except subprocess.CalledProcessError:
143149
return False

0 commit comments

Comments
 (0)