changeset 972:d4eacd47d487 default

merged pg-next-1099 -> default
author Alain Mazy <am@orthanc.team>
date Fri, 18 Sep 2026 14:47:35 +0200
parents 8f29b8a52125 (current diff) 75fa071ae688 (diff)
children
files
diffstat 6 files changed, 54 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/NewTests/NonRegressionPerfs/docker-compose.yml	Mon Sep 14 14:25:04 2026 +0200
+++ b/NewTests/NonRegressionPerfs/docker-compose.yml	Fri Sep 18 14:47:35 2026 +0200
@@ -1,11 +1,13 @@
 services:
 
   orthanc-ref:
-    image: orthancteam/orthanc:26.1.0
+    image: orthancteam/orthanc:26.9.0
     depends_on: [orthanc-ref-db]
     restart: unless-stopped
     ports: ["8142:8042"]
-    volumes: ["storage-orthanc-ref:/var/lib/orthanc/db"]
+    volumes: 
+      - storage-orthanc-ref:/var/lib/orthanc/db
+      - ./plugin.py:/scripts/plugin.py
     environment:
       VERBOSE_ENABLED: "true"
       ORTHANC__POSTGRESQL__HOST: "orthanc-ref-db"
@@ -13,7 +15,8 @@
         {
           "Name": "Orthanc-ref",
           "AuthenticationEnabled": false,
-          "OverwriteInstances": true
+          "OverwriteInstances": true,
+          "PythonScript": "/scripts/plugin.py"
         }
 
   orthanc-new:
@@ -21,7 +24,9 @@
     depends_on: [orthanc-new-db]
     restart: unless-stopped
     ports: ["8143:8042"]
-    volumes: ["storage-orthanc-new:/var/lib/orthanc/db"]
+    volumes: 
+      - storage-orthanc-new:/var/lib/orthanc/db
+      - ./plugin.py:/scripts/plugin.py
     environment:
       VERBOSE_ENABLED: "true"
       ORTHANC__POSTGRESQL__HOST: "orthanc-new-db"
@@ -29,7 +34,8 @@
         {
           "Name": "Orthanc-under-tests",
           "AuthenticationEnabled": false,
-          "OverwriteInstances": true
+          "OverwriteInstances": true,
+          "PythonScript": "/scripts/plugin.py"
         }
 
 
@@ -51,7 +57,7 @@
 
 
   orthanc-ref-s3:
-    image: orthancteam/orthanc:26.1.0
+    image: orthancteam/orthanc:26.9.0
     depends_on: [orthanc-ref-db-s3]
     restart: unless-stopped
     ports: ["8242:8042"]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NewTests/NonRegressionPerfs/plugin.py	Fri Sep 18 14:47:35 2026 +0200
@@ -0,0 +1,13 @@
+import orthanc
+import json
+
+def update_custom_data(output, uri, **request):
+    if request['method'] == 'POST':
+        instance_id = request['groups'][0]
+
+        attachment_uuid = json.loads(orthanc.RestApiGet(f'/instances/{instance_id}/attachments/dicom/info'))['Uuid']
+        orthanc.SetAttachmentCustomData(attachment_uuid, b'dummy')
+
+    output.AnswerBuffer('ok', 'text/plain')
+
+orthanc.RegisterRestCallback('/instances/(.*)/update-custom-data', update_custom_data)
\ No newline at end of file
--- a/NewTests/NonRegressionPerfs/test_non_regression_perfs.py	Mon Sep 14 14:25:04 2026 +0200
+++ b/NewTests/NonRegressionPerfs/test_non_regression_perfs.py	Fri Sep 18 14:47:35 2026 +0200
@@ -1,6 +1,7 @@
 import subprocess
 import time
 import unittest
+import random
 from orthanc_api_client import OrthancApiClient
 from orthanc_tools import OrthancTestDbPopulator
 from helpers import Helpers, wait_container_healthy
@@ -141,7 +142,19 @@
         print(f"{'-'*129}")
 
         self.measure(test_name="populate 3000 instances with 5 workers",
-                     perform_test=lambda o: OrthancTestDbPopulator(o, studies_count=5, series_count=3, instances_count=120, random_seed=65, worker_threads_count=5).execute(),
+                     perform_test=lambda o: OrthancTestDbPopulator(o, studies_count=50, series_count=3, instances_count=120, random_seed=65, worker_threads_count=5).execute(),
+                     reapeat_count=1,
+                     test_configs=test_configs,
+                     test_results=test_results)
+
+        self.measure(test_name="update attachments custom data (1000)",
+                     perform_test=lambda o: [o.post(f"/instances/{i}/update-custom-data", json={}) for i in random.sample(o.instances.get_all_ids(), 2000)],
+                     reapeat_count=1,
+                     test_configs=test_configs,
+                     test_results=test_results)
+
+        self.measure(test_name="access individual instances metadata (1000)",
+                     perform_test=lambda o: [o.instances.get_metadata(i) for i in random.sample(o.instances.get_all_ids(), 1000)],
                      reapeat_count=1,
                      test_configs=test_configs,
                      test_results=test_results)
--- a/NewTests/PostgresUpgrades/docker-compose.yml	Mon Sep 14 14:25:04 2026 +0200
+++ b/NewTests/PostgresUpgrades/docker-compose.yml	Fri Sep 18 14:47:35 2026 +0200
@@ -17,7 +17,7 @@
 
   # Orthanc previous version
   orthanc-pg-15-previous-revision:
-    image: orthancteam/orthanc:25.11.3
+    image: orthancteam/orthanc:26.9.0
     container_name: orthanc-pg-15-previous-revision
     depends_on: [pg-15]
     restart: unless-stopped
@@ -30,7 +30,7 @@
 
   # Orthanc previous version to run the integration tests
   orthanc-pg-15-previous-revision-for-integ-tests:
-    image: orthancteam/orthanc:25.11.3
+    image: orthancteam/orthanc:26.9.0
     container_name: orthanc-pg-15-previous-revision-for-integ-tests
     depends_on: [pg-15]
     restart: unless-stopped
--- a/NewTests/PostgresUpgrades/downgrade.sh	Mon Sep 14 14:25:04 2026 +0200
+++ b/NewTests/PostgresUpgrades/downgrade.sh	Fri Sep 18 14:47:35 2026 +0200
@@ -4,16 +4,20 @@
 
 apt-get update && apt-get install -y wget
 
-# hg clone is often rejected from Azure runners, let's try a download from http
-wget https://orthanc.uclouvain.be/downloads/sources/orthanc-postgresql/OrthancPostgreSQL-10.0.tar.gz --output-document /tmp/pg.tar.gz
-# ex for an intermediate release (or if download from uclouvain is rejected)
-# wget https://public-files.orthanc.team/tmp-builds/hg-repos/orthanc-databases-81d837d7d20d.tar.gz --output-document /tmp/pg.tar.gz
+    # # hg clone is often rejected from Azure runners, let's try a download from http
+    # wget https://orthanc.uclouvain.be/downloads/sources/orthanc-postgresql/OrthancPostgreSQL-10.0.tar.gz --output-document /tmp/pg.tar.gz
+    # # ex for an intermediate release (or if download from uclouvain is rejected)
+    # # wget https://public-files.orthanc.team/tmp-builds/hg-repos/orthanc-databases-81d837d7d20d.tar.gz --output-document /tmp/pg.tar.gz
 
-mkdir -p /scripts/orthanc-databases/
-pushd /scripts/orthanc-databases/
-tar xvf /tmp/pg.tar.gz --strip-components=1
+    # mkdir -p /scripts/orthanc-databases/
+    # pushd /scripts/orthanc-databases/
+    # tar xvf /tmp/pg.tar.gz --strip-components=1
 
-psql -U postgres -f /scripts/orthanc-databases/PostgreSQL/Plugins/SQL/Downgrades/Rev10ToRev6.sql
+    # psql -U postgres -f /scripts/orthanc-databases/PostgreSQL/Plugins/SQL/Downgrades/Rev10ToRev6.sql
+
+wget https://orthanc.uclouvain.be/hg/orthanc-databases/raw-file/tip/PostgreSQL/Plugins/SQL/Downgrades/Rev1099ToRev10.sql --output-document /tmp/downgrade.sql
+
+psql -U postgres -f /tmp/downgrade.sql
 
 # if you want to test a downgrade procedure, you may use this code ...
 # psql -U postgres -f downgrade.sql
--- a/Tests/Tests.py	Mon Sep 14 14:25:04 2026 +0200
+++ b/Tests/Tests.py	Fri Sep 18 14:47:35 2026 +0200
@@ -10982,7 +10982,7 @@
             studyLastUpdate1 = DoGet(_REMOTE, '/studies/%s/metadata/LastUpdate' % i['ParentStudy'])
             patientLastUpdate1 = DoGet(_REMOTE, '/patients/%s/metadata/LastUpdate' % i['ParentPatient'])
             
-            time.sleep(1.01)
+            time.sleep(1.1)
             DoDelete(_REMOTE, '/instances/%s' % j['ID'])
 
             #instanceLastUpdate2 = DoGet(_REMOTE, '/instances/%s/metadata/LastUpdate' % i['ID'])