diff NewTests/main.py @ 474:6917a26881ed

NewTests working with Docker
author Alain Mazy <am@osimis.io>
date Mon, 02 May 2022 17:05:42 +0200
parents 4ee85b016a40
children fe37cf5e9c02
line wrap: on
line diff
--- a/NewTests/main.py	Sat Apr 30 19:38:34 2022 +0200
+++ b/NewTests/main.py	Mon May 02 17:05:42 2022 +0200
@@ -5,7 +5,7 @@
 import argparse
 from helpers import Helpers
 import pathlib
-# python3 main.py --orthanc_under_tests_exe=/home/alain/o/build/orthanc/Orthanc --pattern=Housekeeper.test_housekeeper.TestHousekeeper.*test_is* --plugin=/home/alain/o/build/orthanc/libHousekeeper.so
+# python3 main.py --orthanc_under_tests_exe=/home/alain/o/build/orthanc/Orthanc --pattern=Housekeeper.test_housekeeper.TestHousekeeper.* --plugin=/home/alain/o/build/orthanc/libHousekeeper.so
 
 here = pathlib.Path(__file__).parent.resolve()
 
@@ -23,7 +23,8 @@
     parser.add_argument('--orthanc_under_tests_http_port', type=int, default=8042, help="orthanc under tests HTTP port")
     parser.add_argument('--orthanc_under_tests_exe', type=str, default=None, help="path to the orthanc executable (if it must be launched by this script)")
     parser.add_argument('--orthanc_previous_version_exe', type=str, default=None, help="path to the orthanc executable used to prepare previous version of storage/db (if it must be launched by this script and if different from orthanc_under_tests_exe)")
-    parser.add_argument('--orthanc_under_tests_docker_image', type=str, default=None, help="tag of the Docker image of the orthanc under tests (if it must be launched by this script)")
+    parser.add_argument('--orthanc_under_tests_docker_image', type=str, default=None, help="Docker image of the orthanc under tests (if it must be launched by this script)")
+    parser.add_argument('--orthanc_previous_version_docker_image', type=str, default=None, help="Docker image of the orthanc version used to prepare previous version of storage/db (if it must be launched by this script)")
     parser.add_argument('--skip_preparation', action='store_true', help="if this is a multi stage tests with preparations, skip the preparation")
     parser.add_argument('--break_after_preparation', action='store_true', help="if this is a multi stage tests with preparations, pause after the preparation (such that you can start your own orthanc-under-tests in your debugger)")
     parser.add_argument('-p', '--plugin', dest='plugins', action='append', type=str, help='path to a plugin to add to configuration')
@@ -36,14 +37,21 @@
 
     Helpers.orthanc_under_tests_hostname = args.orthanc_under_tests_hostname
     Helpers.orthanc_under_tests_http_port = args.orthanc_under_tests_http_port
+    Helpers.plugins = args.plugins
+
     Helpers.orthanc_under_tests_exe = args.orthanc_under_tests_exe
-    Helpers.plugins = args.plugins
+    Helpers.orthanc_under_tests_docker_image = args.orthanc_under_tests_docker_image
+
     if args.orthanc_previous_version_exe:
         Helpers.orthanc_previous_version_exe = args.orthanc_previous_version_exe
     else:
         Helpers.orthanc_previous_version_exe = args.orthanc_under_tests_exe
 
-    Helpers.orthanc_under_tests_docker_image = args.orthanc_under_tests_docker_image
+    if args.orthanc_previous_version_docker_image:
+        Helpers.orthanc_previous_version_docker_image = args.orthanc_previous_version_docker_image
+    else:
+        Helpers.orthanc_previous_version_docker_image = args.orthanc_under_tests_docker_image
+
     if args.skip_preparation:
         Helpers.skip_preparation = True
     if args.break_after_preparation: