Mercurial > hg > orthanc-tests
comparison NewTests/PostgresUpgrades/test_pg_upgrades.py @ 628:ddf83317c7e0
patch compose env vars
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 22 Feb 2024 09:29:09 +0100 |
parents | 3bb4b2589030 |
children | e1bc43b5a7d2 |
comparison
equal
deleted
inserted
replaced
627:76c9923050b5 | 628:ddf83317c7e0 |
---|---|
49 print("Stopping Orthanc with 6.1 DB") | 49 print("Stopping Orthanc with 6.1 DB") |
50 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-61"], check=True) | 50 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-61"], check=True) |
51 time.sleep(2) | 51 time.sleep(2) |
52 | 52 |
53 print("Launching newest Orthanc") | 53 print("Launching newest Orthanc") |
54 subprocesss_env = os.environ.copy() | |
55 subprocesss_env["ORTHANC_IMAGE_UNDER_TESTS"] = Helpers.orthanc_under_tests_docker_image | |
54 subprocess.run(["docker", "compose", "up", "orthanc-pg-15-under-tests", "-d"], | 56 subprocess.run(["docker", "compose", "up", "orthanc-pg-15-under-tests", "-d"], |
55 env= { | 57 env=subprocesss_env, check=True) |
56 "ORTHANC_IMAGE_UNDER_TESTS": Helpers.orthanc_under_tests_docker_image | 58 |
57 }, | |
58 check=True) | |
59 | 59 |
60 o = OrthancApiClient("http://localhost:8050") | 60 o = OrthancApiClient("http://localhost:8050") |
61 o.wait_started() | 61 o.wait_started() |
62 | 62 |
63 # make sure we can 'play' with this Orthanc | 63 # make sure we can 'play' with this Orthanc |
94 print("Stopping old Orthanc ") | 94 print("Stopping old Orthanc ") |
95 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-2"], check=True) | 95 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-2"], check=True) |
96 time.sleep(2) | 96 time.sleep(2) |
97 | 97 |
98 print("Launching newest Orthanc") | 98 print("Launching newest Orthanc") |
99 subprocesss_env = os.environ.copy() | |
100 subprocesss_env["ORTHANC_IMAGE_UNDER_TESTS"] = Helpers.orthanc_under_tests_docker_image | |
99 subprocess.run(["docker", "compose", "up", "orthanc-pg-15-under-tests", "-d"], | 101 subprocess.run(["docker", "compose", "up", "orthanc-pg-15-under-tests", "-d"], |
100 env= { | 102 env=subprocesss_env, check=True) |
101 "ORTHANC_IMAGE_UNDER_TESTS": Helpers.orthanc_under_tests_docker_image | |
102 }, | |
103 check=True) | |
104 | 103 |
105 o = OrthancApiClient("http://localhost:8050") | 104 o = OrthancApiClient("http://localhost:8050") |
106 o.wait_started() | 105 o.wait_started() |
107 | 106 |
108 # make sure we can 'play' with Orthanc | 107 # make sure we can 'play' with Orthanc |
157 print("Launching PG-9 server") | 156 print("Launching PG-9 server") |
158 subprocess.run(["docker", "compose", "up", "pg-9", "-d"], check=True) | 157 subprocess.run(["docker", "compose", "up", "pg-9", "-d"], check=True) |
159 wait_container_healthy("pg-9") | 158 wait_container_healthy("pg-9") |
160 | 159 |
161 print("Launching newest Orthanc") | 160 print("Launching newest Orthanc") |
162 subprocess.run( | 161 subprocesss_env = os.environ.copy() |
163 ["docker", "compose", "up", "orthanc-pg-9-under-tests", "-d"], | 162 subprocesss_env["ORTHANC_IMAGE_UNDER_TESTS"] = Helpers.orthanc_under_tests_docker_image |
164 env= { | 163 subprocess.run(["docker", "compose", "up", "orthanc-pg-9-under-tests", "-d"], |
165 "ORTHANC_IMAGE_UNDER_TESTS": Helpers.orthanc_under_tests_docker_image | 164 env=subprocesss_env, check=True) |
166 }, | |
167 check=True) | |
168 | 165 |
169 o = OrthancApiClient("http://localhost:8051") | 166 o = OrthancApiClient("http://localhost:8051") |
170 o.wait_started() | 167 o.wait_started() |
171 instances = o.upload_folder(here / "../../Database/Knee") | 168 instances = o.upload_folder(here / "../../Database/Knee") |
172 o.instances.delete(orthanc_ids=instances) | 169 o.instances.delete(orthanc_ids=instances) |