changeset 699:e3d41c4168c3 attach-custom-data

fix custom data tests
author Alain Mazy <am@orthanc.team>
date Thu, 26 Sep 2024 12:19:36 +0200
parents 7282c2df963d
children 9af8e3ee07d9
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, 26 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/NewTests/PostgresUpgrades/docker-compose.yml	Wed Sep 25 19:37:06 2024 +0200
+++ b/NewTests/PostgresUpgrades/docker-compose.yml	Thu Sep 26 12:19:36 2024 +0200
@@ -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.9.1
+    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.9.1
+    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	Wed Sep 25 19:37:06 2024 +0200
+++ b/NewTests/PostgresUpgrades/downgrade.sh	Thu Sep 26 12:19:36 2024 +0200
@@ -2,9 +2,9 @@
 
 pushd /scripts
 
-# TODO: change pg-transactions by the plugin version number !
-apt-get update && apt-get install -y wget && wget https://orthanc.uclouvain.be/hg/orthanc-databases/raw-file/default/PostgreSQL/Plugins/SQL/Downgrades/Rev2ToRev1.sql
-psql -U postgres -f Rev2ToRev1.sql
+# TODO: change attach-custom-data by the plugin version number or "default" !
+apt-get update && apt-get install -y wget && wget https://orthanc.uclouvain.be/hg/orthanc-databases/raw-file/attach-custom-data/PostgreSQL/Plugins/SQL/Downgrades/Rev3ToRev2.sql
+psql -U postgres -f 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	Wed Sep 25 19:37:06 2024 +0200
+++ b/NewTests/PostgresUpgrades/run-integ-tests-from-docker.sh	Thu Sep 26 12:19:36 2024 +0200
@@ -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	Wed Sep 25 19:37:06 2024 +0200
+++ b/NewTests/PostgresUpgrades/test_pg_upgrades.py	Thu Sep 26 12:19:36 2024 +0200
@@ -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 6rev2 DB")
+        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 6rev2 DB")
+        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,13 +135,13 @@
         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
-        # subprocess.run(["docker", "compose", "create", "orthanc-tests"], check=True)
+        # 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()
+        o = OrthancApiClient("http://localhost:8053", user="alice", pwd="orthanctest")
+        o.wait_started()
 
         # time.sleep(10000)
         subprocess.run(["docker", "compose", "up", "orthanc-tests"], check=True)