Mercurial > hg > orthanc-tests
changeset 742:89cb780d8a11 find-refactoring
pg upgrade
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Wed, 27 Nov 2024 09:30:47 +0100 |
parents | 5d04bdbd4906 |
children | 0ec0c9ed5433 |
files | NewTests/PostgresUpgrades/docker-compose.yml NewTests/PostgresUpgrades/downgrade.sh NewTests/PostgresUpgrades/run-integ-tests-from-docker.sh NewTests/PostgresUpgrades/test_pg_upgrades.py |
diffstat | 4 files changed, 22 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/NewTests/PostgresUpgrades/docker-compose.yml Fri Nov 15 09:38:29 2024 +0100 +++ b/NewTests/PostgresUpgrades/docker-compose.yml Wed Nov 27 09:30:47 2024 +0100 @@ -17,9 +17,9 @@ AC_AUTHENTICATION_ENABLED: "false" # Orthanc previous version - orthanc-pg-15-61: - image: orthancteam/orthanc:24.1.2 - container_name: orthanc-pg-15-61 + orthanc-pg-15-6rev2: + image: orthancteam/orthanc:24.10.3 + container_name: orthanc-pg-15-6rev2 depends_on: [pg-15] restart: unless-stopped ports: ["8052:8042"] @@ -30,9 +30,9 @@ ORTHANC__AUTHENTICATION_ENABLED: "false" # Orthanc previous version to run the integration tests - orthanc-pg-15-61-for-integ-tests: - image: orthancteam/orthanc:24.1.2 - container_name: orthanc-pg-15-61-for-integ-tests + orthanc-pg-15-6rev2-for-integ-tests: + image: orthancteam/orthanc:24.10.3 + container_name: orthanc-pg-15-6rev2-for-integ-tests depends_on: [pg-15] restart: unless-stopped ports: ["8053:8042"] @@ -51,7 +51,7 @@ image: jodogne/orthanc-tests container_name: orthanc-tests depends_on: - - orthanc-pg-15-61-for-integ-tests + - orthanc-pg-15-6rev2-for-integ-tests volumes: - ../../:/tests/orthanc-tests - ./wait-for-it.sh:/scripts/wait-for-it.sh
--- a/NewTests/PostgresUpgrades/downgrade.sh Fri Nov 15 09:38:29 2024 +0100 +++ b/NewTests/PostgresUpgrades/downgrade.sh Wed Nov 27 09:30:47 2024 +0100 @@ -4,7 +4,8 @@ apt-get update && apt-get install -y wget mercurial hg clone https://orthanc.uclouvain.be/hg/orthanc-databases -psql -U postgres -f /scripts/orthanc-databases/PostgreSQL/Plugins/SQL/Downgrades/Rev2ToRev1.sql +hg update -r find-refactoring +psql -U postgres -f /scripts/orthanc-databases/PostgreSQL/Plugins/SQL/Downgrades/Rev3ToRev2.sql # if you want to test a downgrade procedure, you may use this code ... # psql -U postgres -f downgrade.sql
--- a/NewTests/PostgresUpgrades/run-integ-tests-from-docker.sh Fri Nov 15 09:38:29 2024 +0100 +++ b/NewTests/PostgresUpgrades/run-integ-tests-from-docker.sh Wed Nov 27 09:30:47 2024 +0100 @@ -2,6 +2,6 @@ set -ex -/scripts/wait-for-it.sh orthanc-pg-15-61-for-integ-tests:8042 -t 60 -# python /tests/orthanc-tests/Tests/Run.py --server=orthanc-pg-15-61-for-integ-tests --force --docker -- -v Orthanc.test_lua_deadlock -python /tests/orthanc-tests/Tests/Run.py --server=orthanc-pg-15-61-for-integ-tests --force --docker -- -v +/scripts/wait-for-it.sh orthanc-pg-15-6rev2-for-integ-tests:8042 -t 60 +# python /tests/orthanc-tests/Tests/Run.py --server=orthanc-pg-15-6rev2-for-integ-tests --force --docker -- -v Orthanc.test_lua_deadlock +python /tests/orthanc-tests/Tests/Run.py --server=orthanc-pg-15-6rev2-for-integ-tests --force --docker -- -v
--- a/NewTests/PostgresUpgrades/test_pg_upgrades.py Fri Nov 15 09:38:29 2024 +0100 +++ b/NewTests/PostgresUpgrades/test_pg_upgrades.py Wed Nov 27 09:30:47 2024 +0100 @@ -27,7 +27,7 @@ cls.cleanup() - def test_upgrade_61_to_62(self): + def test_upgrade_6rev2_to_6rev3(self): # remove everything including the DB from previous tests TestPgUpgrades.cleanup() @@ -38,16 +38,16 @@ subprocess.run(["docker", "compose", "up", "pg-15", "-d"], check=True) wait_container_healthy("pg-15") - print("Launching Orthanc with 6.1 DB") - subprocess.run(["docker", "compose", "up", "orthanc-pg-15-61", "-d"], check=True) + print("Launching Orthanc with DB 6rev2") + subprocess.run(["docker", "compose", "up", "orthanc-pg-15-6rev2", "-d"], check=True) o = OrthancApiClient("http://localhost:8052") o.wait_started() instances = o.upload_folder(here / "../../Database/Knee") - print("Stopping Orthanc with 6.1 DB") - subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-61"], check=True) + print("Stopping Orthanc with DB 6rev2") + subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-6rev2"], check=True) time.sleep(2) print("Launching newest Orthanc") @@ -115,12 +115,12 @@ subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-under-tests"], check=True) time.sleep(2) - print("Downgrading Orthanc DB to Rev1") + print("Downgrading Orthanc DB to 6rev2") subprocess.run(["docker", "exec", "pg-15", "./scripts/downgrade.sh"], check=True) time.sleep(2) - print("Launching previous Orthanc (DB Rev1)") - subprocess.run(["docker", "compose", "up", "orthanc-pg-15-61", "-d"], check=True) + print("Launching previous Orthanc (DB 6rev2)") + subprocess.run(["docker", "compose", "up", "orthanc-pg-15-6rev2", "-d"], check=True) o = OrthancApiClient("http://localhost:8052") o.wait_started() @@ -135,10 +135,10 @@ self.assertEqual(0, int(o.get_json('statistics')['TotalDiskSize'])) print("run the integration tests after a downgrade") - # first create the containers (orthanc-tests + orthanc-pg-15-61-for-integ-tests) so they know each other + # first create the containers (orthanc-tests + orthanc-pg-15-6rev2-for-integ-tests) so they know each other # subprocess.run(["docker", "compose", "create", "orthanc-tests"], check=True) - # subprocess.run(["docker", "compose", "up", "orthanc-pg-15-61-for-integ-tests", "-d"], check=True) + # subprocess.run(["docker", "compose", "up", "orthanc-pg-15-6rev2-for-integ-tests", "-d"], check=True) # o = OrthancApiClient("http://localhost:8053", user="alice", pwd="orthanctest") # o.wait_started()