view NewTests/README @ 476:77f868063bb3

cleanup
author Alain Mazy <am@osimis.io>
date Tue, 03 May 2022 17:10:29 +0200
parents 6917a26881ed
children 45c3fe035fed
line wrap: on
line source

This is a new set of tests directly written in python3.  They should be able to handle 
more complex scenarios like upgrades or change of configurations.

Prerequisites:
=============

These tests use python3 and require some modules define in requirements.txt.  Therefore, you need
to first execute 

pip3 install -r requirements.txt 

Introduction:
============

You may use these tests to debug Orthanc on your machine.  In this case, there is 
usually a `preparation` phase and  `execution` phase.  You are usually able to 
interrupt the tests between these 2 phases such that you can start your debugger.
Use the `--break_after_preparation` option to do so.
As well, you may skip the preperation phase thanks to the `--skip_preparation` option.

The orthanc that is being tested is called the `orthanc-under-tests`.

Examples:
========

All-tests:
---------

with a local executable:

python3 NewTests/main.py --pattern=* \
                         --orthanc_under_tests_exe=/home/alain/o/build/orthanc/Orthanc \
                         --orthanc_under_tests_http_port=8043 \
                         --plugin=/home/alain/o/build/orthanc/libHousekeeper.so \
                         --plugin=/home/alain/o/build/orthanc-gdcm/libOrthancGdcm.so


with Docker:

python3 NewTests/main.py --pattern=* \
                         --orthanc_under_tests_docker_image=osimis/orthanc:current \
                         --orthanc_previous_version_docker_image=osimis/orthanc:22.4.0 \
                         --orthanc_under_tests_http_port=8043

Housekeeper:
-----------

Run the Housekeeper tests with your locally build version and break between preparation
and execution to allow you to start your debugger.

python3 NewTests/main.py --pattern=Housekeeper.test_housekeeper.TestHousekeeper.test_before_after_reconstruction \
                         --orthanc_under_tests_exe=/home/alain/o/build/orthanc/Orthanc \
                         --orthanc_under_tests_http_port=8043 \
                         --plugin=/home/alain/o/build/orthanc/libHousekeeper.so \
                         --break_after_preparation

The test script will:
- generate 2 configuration file in the `configurations` folder,
- start your local Orthanc version to prepare the db with one of the configuration file, 
- drive this Orthanc to prepare the DB
- interrupt and instruct you how to start your own version, pointing to the configuration file to use
- execute tests



TODO: implement and document usage with Docker !!!!