Skip to content

Commit 92aec72

Browse files
authored
Merge pull request #502 from opentensor/feat/roman/add-skipp-pulling-docker-image
Add `SKIP_PULL` variable for conftest.py
2 parents 216f288 + 3a6f453 commit 92aec72

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
@@ -107,15 +107,21 @@ def docker_runner(params):
107107
"""Starts a Docker container before tests and gracefully terminates it after."""
108108

109109
def is_docker_running():
110-
"""Check if Docker has been run."""
110+
"""Check if Docker is running and optionally skip pulling the image."""
111111
try:
112112
subprocess.run(
113113
["docker", "info"],
114114
stdout=subprocess.DEVNULL,
115115
stderr=subprocess.DEVNULL,
116116
check=True,
117117
)
118-
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
118+
119+
skip_pull = os.getenv("SKIP_PULL", "0") == "1"
120+
if not skip_pull:
121+
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
122+
else:
123+
print(f"[SKIP_PULL=1] Skipping 'docker pull {LOCALNET_IMAGE_NAME}'")
124+
119125
return True
120126
except subprocess.CalledProcessError:
121127
return False

0 commit comments

Comments
 (0)