Hi Team,
I’ve been having difficulties running the orthanc tests locally on my Mac. I pinpointed the issue with the following:
subprocess.run(["docker", "compose", "-f", "docker-compose-transfers-concurrency.yml", "down", "-v", "--remove-orphans"],
env= {
"ORTHANC_IMAGE_UNDER_TESTS": Helpers.orthanc_under_tests_docker_image
},
check=True)
The issue is that by setting env=...
this overrides the parent process env, removing required env vars for docker to run correctly. In my case, it leads to “file not found” exceptions.
I would suggest the following
subprocesss_env = os.environ.copy()
subprocesss_env["ORTHANC_IMAGE_UNDER_TESTS"] = Helpers.orthanc_under_tests_docker_image
subprocess.run(["docker", "compose", "-f", "docker-compose-transfers-concurrency.yml", "down", "-v", "--remove-orphans"],
env=subprocesss_env, check=True)
Which creates a copy of the current process environment, adds the new var and then calls docker with this env copy. This allows docker to run (at least in my environment).
Hope this helps.
Cheers,
James