diff --git a/tests/e2e_tests/conftest.py b/tests/e2e_tests/conftest.py index ba2c6c019..1b93ac0ae 100644 --- a/tests/e2e_tests/conftest.py +++ b/tests/e2e_tests/conftest.py @@ -107,7 +107,7 @@ 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"], @@ -115,7 +115,13 @@ def is_docker_running(): 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