holado 0.2.4__py3-none-any.whl → 0.2.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of holado might be problematic. Click here for more details.

Files changed (49) hide show
  1. holado/__init__.py +62 -26
  2. holado/common/context/service_manager.py +10 -2
  3. holado/common/context/session_context.py +43 -12
  4. holado/common/handlers/object.py +14 -5
  5. holado/common/handlers/undefined.py +16 -6
  6. holado/holado_config.py +1 -0
  7. {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/METADATA +1 -1
  8. {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/RECORD +49 -48
  9. holado_core/common/block/scope_steps.py +2 -2
  10. holado_core/common/resource/persisted_method_to_call_manager.py +2 -2
  11. holado_core/common/tools/path_manager.py +8 -4
  12. holado_core/common/tools/tools.py +24 -7
  13. holado_grpc/api/rpc/grpc_client.py +122 -118
  14. holado_helper/docker/logging.conf +3 -1
  15. holado_helper/docker/run_holado_test_nonreg_in_docker.sh +28 -28
  16. holado_helper/docker/run_terminal_in_docker-with_docker_control.sh +27 -27
  17. holado_helper/docker/run_terminal_in_docker.sh +26 -26
  18. holado_helper/initialize_holado.py +72 -0
  19. holado_helper/script/action.py +21 -9
  20. holado_helper/script/initialize_script.py +8 -28
  21. holado_helper/script/script.py +2 -2
  22. holado_logging/__init__.py +5 -8
  23. holado_logging/common/logging/holado_logger.py +2 -2
  24. holado_logging/common/logging/log_config.py +43 -18
  25. holado_logging/common/logging/log_manager.py +20 -19
  26. holado_multitask/multitasking/multitask_manager.py +1 -1
  27. holado_multitask/multithreading/thread.py +8 -4
  28. holado_protobuf/ipc/protobuf/protobuf_messages.py +1 -1
  29. holado_scripting/common/tools/evaluate_parameters.py +23 -5
  30. holado_scripting/common/tools/expression_evaluator.py +115 -113
  31. holado_scripting/tests/behave/steps/scenario/if_steps.py +2 -2
  32. holado_scripting/text/interpreter/functions/function_hex_to_bytes.py +1 -1
  33. holado_scripting/text/interpreter/text_interpreter.py +20 -21
  34. holado_test/behave/behave_environment.py +31 -12
  35. holado_test/behave/independant_runner.py +3 -5
  36. holado_test/scenario/step_tools.py +13 -12
  37. holado_test/scenario/tester_tools.py +3 -1
  38. holado_value/common/tables/comparators/table_2_value_table_cell_comparator.py +1 -1
  39. holado_value/common/tables/converters/value_table_converter.py +1 -1
  40. holado_value/common/tables/value_table_cell.py +5 -1
  41. holado_value/common/tools/value.py +56 -33
  42. holado_value/common/tools/value_types.py +6 -0
  43. test_holado/environment.py +1 -1
  44. test_holado/features/NonReg/{ipc → holado_binary}/bit_series.feature +13 -0
  45. test_holado/features/NonReg/test_steps/common.feature +1 -1
  46. test_holado/logging.conf +3 -1
  47. {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/WHEEL +0 -0
  48. {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/licenses/LICENSE +0 -0
  49. /test_holado/features/NonReg/{ipc → holado_binary}/bit_series.error.feature +0 -0
@@ -47,135 +47,139 @@ class GRpcClient(object):
47
47
  def is_available(cls):
48
48
  return with_grpc_requests
49
49
 
50
- def __init__(self, name, endpoint, **kwargs):
51
- self.__name = name
52
- self.__endpoint = endpoint
53
- self.__kwargs = kwargs
54
- self.__client = grpc_requests.client.get_by_endpoint(endpoint, **kwargs)
55
-
56
- self.__func_grpc_services = None
57
- self.__func_protobuf_converter = None
58
- self.__func_protobuf_messages = None
59
-
60
- def initialize(self, func_grpc_services, func_protobuf_converter, func_protobuf_messages):
61
- self.__func_grpc_services = func_grpc_services
62
- self.__func_protobuf_converter = func_protobuf_converter
63
- self.__func_protobuf_messages = func_protobuf_messages
50
+ if with_grpc_requests:
51
+ def __init__(self, name, endpoint, **kwargs):
52
+ self.__name = name
53
+ self.__endpoint = endpoint
54
+ self.__kwargs = kwargs
55
+ self.__client = grpc_requests.client.get_by_endpoint(endpoint, **kwargs)
56
+
57
+ self.__func_grpc_services = None
58
+ self.__func_protobuf_converter = None
59
+ self.__func_protobuf_messages = None
64
60
 
65
- @property
66
- def __grpc_services(self):
67
- return self.__func_grpc_services()
68
-
69
- @property
70
- def __protobuf_converter(self):
71
- return self.__func_protobuf_converter()
72
-
73
- @property
74
- def __protobuf_messages(self):
75
- return self.__func_protobuf_messages()
76
-
77
- @property
78
- def name(self):
79
- return self.__name
61
+ def initialize(self, func_grpc_services, func_protobuf_converter, func_protobuf_messages):
62
+ self.__func_grpc_services = func_grpc_services
63
+ self.__func_protobuf_converter = func_protobuf_converter
64
+ self.__func_protobuf_messages = func_protobuf_messages
65
+
66
+ @property
67
+ def __grpc_services(self):
68
+ return self.__func_grpc_services()
80
69
 
81
- @property
82
- def internal_client(self) -> grpc_requests.client.Client:
83
- return self.__client
70
+ @property
71
+ def __protobuf_converter(self):
72
+ return self.__func_protobuf_converter()
84
73
 
85
- def request(self, service, method, request, raw_output=False, **kwargs):
86
- """
87
- :param request: request data in json or proto format
88
- :param raw_output: if method should return a proto object or a json oject (default: False)
89
- :param kwargs: other arguments for underlying grpc_requests method, or further underlying grpc method (ex: 'timeout')
90
- :returns: if raw_output==True, returns a proto object, else returns a json object with proto data
91
- """
92
- logger.info(f"Requesting {service}.{method} with data [{request}] (raw_output: {raw_output} ; kwargs:{kwargs})")
74
+ @property
75
+ def __protobuf_messages(self):
76
+ return self.__func_protobuf_messages()
93
77
 
94
- # Set a default timeout
95
- raise_on_timeout = False
96
- if kwargs is None:
97
- kwargs = {}
98
- if 'timeout' not in kwargs:
99
- kwargs['timeout'] = Config.join_timeout_seconds
100
- raise_on_timeout = True
101
- timeout = kwargs['timeout'] if 'timeout' in kwargs else None
78
+ @property
79
+ def name(self):
80
+ return self.__name
102
81
 
103
- success = False
104
- last_exc = None
105
- for try_nb in range(1,4):
106
- try:
107
- # Ask always raw_output=True, so that we get a Protobuf instance, and then conversion is done if needed
108
- res_proto = self.internal_client.request(service, method, request, raw_output=True, **kwargs)
109
- except Exception as exc:
110
- last_exc = exc
111
- exc_str = str(exc)
112
- msg_list = [
113
- f"Request failed (try {try_nb}):",
114
- f" method: {service}.{method}",
115
- f" data:",
116
- Tools.indent_string(8, str(request)),
117
- f" raw_output: {raw_output}",
118
- f" kwargs: {kwargs}",
119
- f" error:",
120
- Tools.indent_string(8, exc_str) ]
121
- exc_msg = "\n".join(msg_list)
122
- if "status = StatusCode.UNAVAILABLE" in exc_str:
123
- logger.warning("Service temporarily unavailable:\n" + exc_msg)
124
- time.sleep(1)
125
- continue
126
- elif "status = StatusCode.DEADLINE_EXCEEDED" in exc_str:
127
- if raise_on_timeout:
128
- raise TimeoutTechnicalException(exc_msg)
129
- else:
130
- logger.warning(f"Timeout ({timeout} s) occured while requesting:\n" + exc_msg)
82
+ @property
83
+ def internal_client(self) -> grpc_requests.client.Client:
84
+ return self.__client
85
+
86
+ def request(self, service, method, request, raw_output=False, **kwargs):
87
+ """
88
+ :param request: request data in json or proto format
89
+ :param raw_output: if method should return a proto object or a json oject (default: False)
90
+ :param kwargs: other arguments for underlying grpc_requests method, or further underlying grpc method (ex: 'timeout')
91
+ :returns: if raw_output==True, returns a proto object, else returns a json object with proto data
92
+ """
93
+ logger.info(f"Requesting {service}.{method} with data [{request}] (raw_output: {raw_output} ; kwargs:{kwargs})")
94
+
95
+ # Set a default timeout
96
+ raise_on_timeout = False
97
+ if kwargs is None:
98
+ kwargs = {}
99
+ if 'timeout' not in kwargs:
100
+ kwargs['timeout'] = Config.join_timeout_seconds
101
+ raise_on_timeout = True
102
+ timeout = kwargs['timeout'] if 'timeout' in kwargs else None
103
+
104
+ success = False
105
+ last_exc = None
106
+ for try_nb in range(1,4):
107
+ try:
108
+ # Ask always raw_output=True, so that we get a Protobuf instance, and then conversion is done if needed
109
+ res_proto = self.internal_client.request(service, method, request, raw_output=True, **kwargs)
110
+ except Exception as exc:
111
+ last_exc = exc
112
+ exc_str = str(exc)
113
+ msg_list = [
114
+ f"Request failed (try {try_nb}):",
115
+ f" method: {service}.{method}",
116
+ f" data:",
117
+ Tools.indent_string(8, str(request)),
118
+ f" raw_output: {raw_output}",
119
+ f" kwargs: {kwargs}",
120
+ f" error:",
121
+ Tools.indent_string(8, exc_str) ]
122
+ exc_msg = "\n".join(msg_list)
123
+ if "status = StatusCode.UNAVAILABLE" in exc_str:
124
+ logger.warning("Service temporarily unavailable:\n" + exc_msg)
131
125
  time.sleep(1)
132
126
  continue
133
- elif "status = " in exc_str:
134
- raise FunctionalException(exc_msg) from exc
127
+ elif "status = StatusCode.DEADLINE_EXCEEDED" in exc_str:
128
+ if raise_on_timeout:
129
+ raise TimeoutTechnicalException(exc_msg)
130
+ else:
131
+ logger.warning(f"Timeout ({timeout} s) occured while requesting:\n" + exc_msg)
132
+ time.sleep(1)
133
+ continue
134
+ elif "status = " in exc_str:
135
+ raise FunctionalException(exc_msg) from exc
136
+ else:
137
+ raise TechnicalException(exc_msg) from exc
135
138
  else:
136
- raise TechnicalException(exc_msg) from exc
137
- else:
138
- success = True
139
- break
140
-
141
- if not success:
142
- if "status = " in exc_msg:
143
- raise FunctionalException(exc_msg) from last_exc
144
- else:
145
- raise TechnicalException(exc_msg) from last_exc
139
+ success = True
140
+ break
146
141
 
147
- # Manage result conversion if needed
148
- # Note: this step is done manually since grpc_requests has some limitations when raw_output=False:
149
- # - Field with default values are not set in json result
150
- # - Some field types are badly managed (ex: uint64 fields appear as string in json)
151
- if raw_output == True:
152
- if isinstance(res_proto, grpc._channel._MultiThreadedRendezvous):
153
- return list(res_proto)
142
+ if not success:
143
+ if "status = " in exc_msg:
144
+ raise FunctionalException(exc_msg) from last_exc
145
+ else:
146
+ raise TechnicalException(exc_msg) from last_exc
147
+
148
+ # Manage result conversion if needed
149
+ # Note: this step is done manually since grpc_requests has some limitations when raw_output=False:
150
+ # - Field with default values are not set in json result
151
+ # - Some field types are badly managed (ex: uint64 fields appear as string in json)
152
+ if raw_output == True:
153
+ if isinstance(res_proto, grpc._channel._MultiThreadedRendezvous):
154
+ return list(res_proto)
155
+ else:
156
+ return res_proto
154
157
  else:
155
- return res_proto
156
- else:
157
- if isinstance(res_proto, grpc._channel._MultiThreadedRendezvous):
158
- res = [self.__protobuf_converter.convert_protobuf_object_to_json_object(cur_res) for cur_res in res_proto]
158
+ if isinstance(res_proto, grpc._channel._MultiThreadedRendezvous):
159
+ res = [self.__protobuf_converter.convert_protobuf_object_to_json_object(cur_res) for cur_res in res_proto]
160
+ else:
161
+ res = self.__protobuf_converter.convert_protobuf_object_to_json_object(res_proto)
162
+ return res
163
+
164
+ def get_request_data_type_fullname(self, service, method):
165
+ method_descriptor = self.__grpc_services.get_method_descriptor(service, method)
166
+ return method_descriptor.input_type.full_name
167
+
168
+ def build_request_data(self, service, method, params_table=None, params_dict=None, as_proto=False):
169
+ if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
170
+ logger.trace(f"Building request data for service method '{service}.{method}'")
171
+ if as_proto is not None and as_proto:
172
+ method_descriptor = self.__grpc_services.get_method_descriptor(service, method)
173
+ res = self.__protobuf_messages.new_message(method_descriptor.input_type.full_name, fields_table=params_table, fields_dict=params_dict)
159
174
  else:
160
- res = self.__protobuf_converter.convert_protobuf_object_to_json_object(res_proto)
161
- return res
175
+ if params_table is not None:
176
+ res = ValueTableConverter.convert_name_value_table_2_json_object(params_table)
177
+ elif params_dict is not None:
178
+ res = params_dict
179
+ else:
180
+ res = {}
162
181
 
163
- def get_request_data_type_fullname(self, service, method):
164
- method_descriptor = self.__grpc_services.get_method_descriptor(service, method)
165
- return method_descriptor.input_type.full_name
182
+ return res
166
183
 
167
- def build_request_data(self, service, method, params_table=None, params_dict=None, as_proto=False):
168
- if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
169
- logger.trace(f"Building request data for service method '{service}.{method}'")
170
- if as_proto is not None and as_proto:
171
- method_descriptor = self.__grpc_services.get_method_descriptor(service, method)
172
- res = self.__protobuf_messages.new_message(method_descriptor.input_type.full_name, fields_table=params_table, fields_dict=params_dict)
173
- else:
174
- if params_table is not None:
175
- res = ValueTableConverter.convert_name_value_table_2_json_object(params_table)
176
- elif params_dict is not None:
177
- res = params_dict
178
- else:
179
- res = {}
180
184
 
181
- return res
185
+
@@ -1,7 +1,9 @@
1
- [logger_root]
1
+ [holado]
2
2
  #level=INFO
3
3
  level=DEBUG
4
4
  #level=TRACE
5
+ log_on_console=False
6
+ log_in_file=True
5
7
 
6
8
  [loggers_levels]
7
9
  holado=INFO
@@ -7,23 +7,23 @@
7
7
  #
8
8
  # USAGE:
9
9
  # Considering a working directory WORK_DIR, to launch scenarios, open a console in WORK_DIR, and launch the script with wanted parameters (see bellow).
10
- # Then a new report is added in folder HOLADO_TEST_OUTPUT_BASEDIR/reports if environment variable HOLADO_TEST_OUTPUT_BASEDIR is defined, else in folder WORK_DIR/reports.
10
+ # Then a new report is added in folder HOLADO_OUTPUT_BASEDIR/reports if environment variable HOLADO_OUTPUT_BASEDIR is defined, else in folder WORK_DIR/reports.
11
11
  #
12
12
  # REQUIREMENTS:
13
13
  # Define in .profile the following variables
14
- # - HOLADO_TEST_IMAGE_TAG: docker image tag to use (usually "main" or tag associated to any branch)
14
+ # - HOLADO_IMAGE_TAG: docker image tag to use (usually "main" or tag associated to any branch)
15
15
  # - optional but preferable:
16
- # - HOLADO_TEST_OUTPUT_BASEDIR: absolute path to base output directory of testing solution
17
- # - HOLADO_TEST_LOCAL_RESOURCES_BASEDIR: absolute path to base local resources directory of testing solution (where data are stored through campaigns)
16
+ # - HOLADO_OUTPUT_BASEDIR: absolute path to base output directory of testing solution
17
+ # - HOLADO_LOCAL_RESOURCES_BASEDIR: absolute path to base local resources directory of testing solution (where data are stored through campaigns)
18
18
  # - optional:
19
- # - HOLADO_TEST_IMAGE_REGISTRY: docker image registry to use (default: "registry.gitlab.com/testing-solution/python")
20
- # - HOLADO_TEST_USE_LOCALHOST: force the container network to 'host'.
21
- # - HOLADO_TEST_NETWORK: specify on which network the docker is run.
19
+ # - HOLADO_IMAGE_REGISTRY: docker image registry to use (default: "registry.gitlab.com/testing-solution/python")
20
+ # - HOLADO_USE_LOCALHOST: force the container network to 'host'.
21
+ # - HOLADO_NETWORK: specify on which network the docker is run.
22
22
  # Example:
23
- # export HOLADO_TEST_IMAGE_TAG=main
24
- # export HOLADO_TEST_USE_LOCALHOST=True
25
- # export HOLADO_TEST_OUTPUT_BASEDIR=$HOME/.holado/output
26
- # export HOLADO_TEST_LOCAL_RESOURCES_BASEDIR=$HOME/.holado/resources
23
+ # export HOLADO_IMAGE_TAG=main
24
+ # export HOLADO_USE_LOCALHOST=True
25
+ # export HOLADO_OUTPUT_BASEDIR=$HOME/.holado/output
26
+ # export HOLADO_LOCAL_RESOURCES_BASEDIR=$HOME/.holado/resources
27
27
  #
28
28
  # If no parameters are added to the script, all features/scenarios are run.
29
29
  # Additional parameters can be specified to change runner behaviors, usually used to execute specific features/scenarios.
@@ -35,7 +35,7 @@
35
35
  # For a complete help on possible parameters, simply add "-h" to command.
36
36
 
37
37
 
38
- for v in HOLADO_TEST_IMAGE_TAG; do
38
+ for v in HOLADO_IMAGE_TAG; do
39
39
  if [ -z ${!v} ]; then
40
40
  echo "Environment variable $v must be set"
41
41
  exit 1
@@ -45,26 +45,26 @@ done
45
45
  CWD="$(dirname "${BASH_SOURCE[0]}")"
46
46
  WORK_DIR="$(pwd)"
47
47
 
48
- if [[ -z "$HOLADO_TEST_IMAGE_REGISTRY" ]]; then
49
- HOLADO_TEST_IMAGE_REGISTRY=registry.gitlab.com/testing-solution/python
48
+ if [[ -z "$HOLADO_IMAGE_REGISTRY" ]]; then
49
+ HOLADO_IMAGE_REGISTRY=registry.gitlab.com/testing-solution/python
50
50
  fi
51
- TEST_IMAGE=${HOLADO_TEST_IMAGE_REGISTRY}:${HOLADO_TEST_IMAGE_TAG}
51
+ TEST_IMAGE=${HOLADO_IMAGE_REGISTRY}:${HOLADO_IMAGE_TAG}
52
52
 
53
53
  # Update docker image
54
54
  echo "Updating docker image ${TEST_IMAGE}..."
55
55
  docker pull ${TEST_IMAGE}
56
56
 
57
57
  # Define test output directory
58
- if [[ ! -z "$HOLADO_TEST_OUTPUT_BASEDIR" ]]; then
59
- OUTPUT_DIR=${HOLADO_TEST_OUTPUT_BASEDIR}
58
+ if [[ ! -z "$HOLADO_OUTPUT_BASEDIR" ]]; then
59
+ OUTPUT_DIR=${HOLADO_OUTPUT_BASEDIR}
60
60
  else
61
61
  OUTPUT_DIR=${WORK_DIR}/output
62
62
  fi
63
63
  echo "Output directory: $OUTPUT_DIR"
64
64
 
65
65
  # Define test resources directory
66
- if [[ ! -z "$HOLADO_TEST_LOCAL_RESOURCES_BASEDIR" ]]; then
67
- RESOURCES_DIR=${HOLADO_TEST_LOCAL_RESOURCES_BASEDIR}
66
+ if [[ ! -z "$HOLADO_LOCAL_RESOURCES_BASEDIR" ]]; then
67
+ RESOURCES_DIR=${HOLADO_LOCAL_RESOURCES_BASEDIR}
68
68
  else
69
69
  RESOURCES_DIR=${WORK_DIR}/resources
70
70
  fi
@@ -81,11 +81,11 @@ if [ ! -d ${RESOURCES_DIR} ]; then
81
81
  fi
82
82
 
83
83
  # Define container network
84
- if [ "$HOLADO_TEST_USE_LOCALHOST" = True ]; then
84
+ if [ "$HOLADO_USE_LOCALHOST" = True ]; then
85
85
  NETWORK_DEF_CMD="--network=host"
86
86
  else
87
- if [[ ! -z "$HOLADO_TEST_NETWORK" ]]; then
88
- NETWORK_DEF_CMD="--network $HOLADO_TEST_NETWORK"
87
+ if [[ ! -z "$HOLADO_NETWORK" ]]; then
88
+ NETWORK_DEF_CMD="--network $HOLADO_NETWORK"
89
89
  else
90
90
  NETWORK_DEF_CMD=""
91
91
  fi
@@ -101,20 +101,20 @@ else
101
101
  fi
102
102
 
103
103
  # Docker run
104
- if [[ -z "$HOLADO_TEST_RUNNER_NAME" ]]; then
105
- HOLADO_TEST_RUNNER_NAME=holado_test_runner
104
+ if [[ -z "$HOLADO_RUNNER_NAME" ]]; then
105
+ HOLADO_RUNNER_NAME=holado_test_runner
106
106
  fi
107
107
 
108
108
  echo
109
- echo "Running tests (docker name: ${HOLADO_TEST_RUNNER_NAME})..."
109
+ echo "Running tests (docker name: ${HOLADO_RUNNER_NAME})..."
110
110
  echo
111
111
  # Note: In bellow command, some non-regression scenarios are skipped, those currently not working when run in docker
112
- docker run --rm -t $((docker info | grep -i rootless > /dev/null && echo -n "--user root") || echo -n "-u $(id -u ${USER}):$(id -g ${USER})") --name ${HOLADO_TEST_RUNNER_NAME} \
112
+ docker run --rm -t $((docker info | grep -i rootless > /dev/null && echo -n "--user root") || echo -n "-u $(id -u ${USER}):$(id -g ${USER})") --name ${HOLADO_RUNNER_NAME} \
113
113
  -v "${OUTPUT_DIR}":/output \
114
114
  -v "${RESOURCES_DIR}":/resources \
115
115
  ${LOGGING_CONF_CMD} \
116
- -e HOLADO_TEST_OUTPUT_BASEDIR=/output \
117
- -e HOLADO_TEST_LOCAL_RESOURCES_BASEDIR=/resources \
116
+ -e HOLADO_OUTPUT_BASEDIR=/output \
117
+ -e HOLADO_LOCAL_RESOURCES_BASEDIR=/resources \
118
118
  ${NETWORK_DEF_CMD} \
119
119
  ${TEST_IMAGE} /bin/bash -c "./run_test_nonreg.sh -t ~grpc -t ~rabbitmq -t ~sftp $*"
120
120
 
@@ -12,22 +12,22 @@
12
12
  #
13
13
  # REQUIREMENTS:
14
14
  # Define in .profile the following variables
15
- # - HOLADO_TEST_IMAGE_TAG: docker image tag to use (usually "main" or tag associated to any branch)
15
+ # - HOLADO_IMAGE_TAG: docker image tag to use (usually "main" or tag associated to any branch)
16
16
  # - optional but preferable:
17
- # - HOLADO_TEST_OUTPUT_BASEDIR: absolute path to base output directory of testing solution
18
- # - HOLADO_TEST_LOCAL_RESOURCES_BASEDIR: absolute path to base local resources directory of testing solution (where data are stored through campaigns)
17
+ # - HOLADO_OUTPUT_BASEDIR: absolute path to base output directory of testing solution
18
+ # - HOLADO_LOCAL_RESOURCES_BASEDIR: absolute path to base local resources directory of testing solution (where data are stored through campaigns)
19
19
  # - optional:
20
- # - HOLADO_TEST_USE_LOCALHOST: force the container network to 'host'.
21
- # - HOLADO_TEST_NETWORK: specify on which network the docker is run.
20
+ # - HOLADO_USE_LOCALHOST: force the container network to 'host'.
21
+ # - HOLADO_NETWORK: specify on which network the docker is run.
22
22
  # Example:
23
- # export HOLADO_TEST_IMAGE_TAG=main
24
- # export HOLADO_TEST_USE_LOCALHOST=True
25
- # export HOLADO_TEST_OUTPUT_BASEDIR=$HOME/.holado/output
26
- # export HOLADO_TEST_LOCAL_RESOURCES_BASEDIR=$HOME/.holado/resources
23
+ # export HOLADO_IMAGE_TAG=main
24
+ # export HOLADO_USE_LOCALHOST=True
25
+ # export HOLADO_OUTPUT_BASEDIR=$HOME/.holado/output
26
+ # export HOLADO_LOCAL_RESOURCES_BASEDIR=$HOME/.holado/resources
27
27
  #
28
28
 
29
29
 
30
- for v in HOLADO_TEST_IMAGE_TAG; do
30
+ for v in HOLADO_IMAGE_TAG; do
31
31
  if [ -z ${!v} ]; then
32
32
  echo "Environment variable $v must be set"
33
33
  exit 1
@@ -36,26 +36,26 @@ done
36
36
 
37
37
  WORK_DIR="$(pwd)"
38
38
 
39
- if [[ -z "$HOLADO_TEST_IMAGE_REGISTRY" ]]; then
40
- HOLADO_TEST_IMAGE_REGISTRY=registry.gitlab.com/testing-solution/python
39
+ if [[ -z "$HOLADO_IMAGE_REGISTRY" ]]; then
40
+ HOLADO_IMAGE_REGISTRY=registry.gitlab.com/testing-solution/python
41
41
  fi
42
- TEST_IMAGE=${HOLADO_TEST_IMAGE_REGISTRY}:${HOLADO_TEST_IMAGE_TAG}
42
+ TEST_IMAGE=${HOLADO_IMAGE_REGISTRY}:${HOLADO_IMAGE_TAG}
43
43
 
44
44
  # Update docker image
45
45
  echo "Updating docker image ${TEST_IMAGE}..."
46
46
  docker pull ${TEST_IMAGE}
47
47
 
48
48
  # Define test output directory
49
- if [[ ! -z "$HOLADO_TEST_OUTPUT_BASEDIR" ]]; then
50
- OUTPUT_DIR=${HOLADO_TEST_OUTPUT_BASEDIR}
49
+ if [[ ! -z "$HOLADO_OUTPUT_BASEDIR" ]]; then
50
+ OUTPUT_DIR=${HOLADO_OUTPUT_BASEDIR}
51
51
  else
52
52
  OUTPUT_DIR=${WORK_DIR}/output
53
53
  fi
54
54
  echo "Output directory: $OUTPUT_DIR"
55
55
 
56
56
  # Define test resources directory
57
- if [[ ! -z "$HOLADO_TEST_LOCAL_RESOURCES_BASEDIR" ]]; then
58
- RESOURCES_DIR=${HOLADO_TEST_LOCAL_RESOURCES_BASEDIR}
57
+ if [[ ! -z "$HOLADO_LOCAL_RESOURCES_BASEDIR" ]]; then
58
+ RESOURCES_DIR=${HOLADO_LOCAL_RESOURCES_BASEDIR}
59
59
  else
60
60
  RESOURCES_DIR=${WORK_DIR}/resources
61
61
  fi
@@ -72,31 +72,31 @@ if [ ! -d ${RESOURCES_DIR} ]; then
72
72
  fi
73
73
 
74
74
  # Define container network
75
- if [ "$HOLADO_TEST_USE_LOCALHOST" = True ]; then
75
+ if [ "$HOLADO_USE_LOCALHOST" = True ]; then
76
76
  NETWORK_DEF_COMMAND="--network=host"
77
77
  else
78
- if [[ ! -z "$HOLADO_TEST_NETWORK" ]]; then
79
- NETWORK_DEF_COMMAND="--network $HOLADO_TEST_NETWORK"
78
+ if [[ ! -z "$HOLADO_NETWORK" ]]; then
79
+ NETWORK_DEF_COMMAND="--network $HOLADO_NETWORK"
80
80
  else
81
81
  NETWORK_DEF_COMMAND=""
82
82
  fi
83
83
  fi
84
84
 
85
85
  # Docker run
86
- if [[ -z "$HOLADO_TEST_RUNNER_NAME" ]]; then
87
- HOLADO_TEST_RUNNER_NAME=holado_test_runner
86
+ if [[ -z "$HOLADO_RUNNER_NAME" ]]; then
87
+ HOLADO_RUNNER_NAME=holado_test_runner
88
88
  fi
89
89
 
90
90
  echo
91
- echo "Running tests (docker name: ${HOLADO_TEST_RUNNER_NAME})..."
91
+ echo "Running tests (docker name: ${HOLADO_RUNNER_NAME})..."
92
92
  echo
93
- #docker run --rm -it $((docker info | grep -i rootless > /dev/null && echo -n "--user root") || echo -n "-u $(id -u ${USER}):$(id -g ${USER})") --name ${HOLADO_TEST_RUNNER_NAME} \
94
- docker run --rm -it --user root --name ${HOLADO_TEST_RUNNER_NAME} \
93
+ #docker run --rm -it $((docker info | grep -i rootless > /dev/null && echo -n "--user root") || echo -n "-u $(id -u ${USER}):$(id -g ${USER})") --name ${HOLADO_RUNNER_NAME} \
94
+ docker run --rm -it --user root --name ${HOLADO_RUNNER_NAME} \
95
95
  --privileged -v /var/run/docker.sock:/var/run/docker.sock \
96
96
  -v "${OUTPUT_DIR}":/output \
97
97
  -v "${RESOURCES_DIR}":/resources \
98
- -e HOLADO_TEST_OUTPUT_BASEDIR=/output \
99
- -e HOLADO_TEST_LOCAL_RESOURCES_BASEDIR=/resources \
98
+ -e HOLADO_OUTPUT_BASEDIR=/output \
99
+ -e HOLADO_LOCAL_RESOURCES_BASEDIR=/resources \
100
100
  ${NETWORK_DEF_COMMAND} \
101
101
  -w /work_dir \
102
102
  ${TEST_IMAGE} /bin/bash
@@ -12,22 +12,22 @@
12
12
  #
13
13
  # REQUIREMENTS:
14
14
  # Define in .profile the following variables
15
- # - HOLADO_TEST_IMAGE_TAG: docker image tag to use (usually "main" or tag associated to any branch)
15
+ # - HOLADO_IMAGE_TAG: docker image tag to use (usually "main" or tag associated to any branch)
16
16
  # - optional but preferable:
17
- # - HOLADO_TEST_OUTPUT_BASEDIR: absolute path to base output directory of testing solution
18
- # - HOLADO_TEST_LOCAL_RESOURCES_BASEDIR: absolute path to base local resources directory of testing solution (where data are stored through campaigns)
17
+ # - HOLADO_OUTPUT_BASEDIR: absolute path to base output directory of testing solution
18
+ # - HOLADO_LOCAL_RESOURCES_BASEDIR: absolute path to base local resources directory of testing solution (where data are stored through campaigns)
19
19
  # - optional:
20
- # - HOLADO_TEST_USE_LOCALHOST: force the container network to 'host'.
21
- # - HOLADO_TEST_NETWORK: specify on which network the docker is run.
20
+ # - HOLADO_USE_LOCALHOST: force the container network to 'host'.
21
+ # - HOLADO_NETWORK: specify on which network the docker is run.
22
22
  # Example:
23
- # export HOLADO_TEST_IMAGE_TAG=main
24
- # export HOLADO_TEST_USE_LOCALHOST=True
25
- # export HOLADO_TEST_OUTPUT_BASEDIR=$HOME/.holado/output
26
- # export HOLADO_TEST_LOCAL_RESOURCES_BASEDIR=$HOME/.holado/resources
23
+ # export HOLADO_IMAGE_TAG=main
24
+ # export HOLADO_USE_LOCALHOST=True
25
+ # export HOLADO_OUTPUT_BASEDIR=$HOME/.holado/output
26
+ # export HOLADO_LOCAL_RESOURCES_BASEDIR=$HOME/.holado/resources
27
27
  #
28
28
 
29
29
 
30
- for v in HOLADO_TEST_IMAGE_TAG; do
30
+ for v in HOLADO_IMAGE_TAG; do
31
31
  if [ -z ${!v} ]; then
32
32
  echo "Environment variable $v must be set"
33
33
  exit 1
@@ -36,26 +36,26 @@ done
36
36
 
37
37
  WORK_DIR="$(pwd)"
38
38
 
39
- if [[ -z "$HOLADO_TEST_IMAGE_REGISTRY" ]]; then
40
- HOLADO_TEST_IMAGE_REGISTRY=registry.gitlab.com/testing-solution/python
39
+ if [[ -z "$HOLADO_IMAGE_REGISTRY" ]]; then
40
+ HOLADO_IMAGE_REGISTRY=registry.gitlab.com/testing-solution/python
41
41
  fi
42
- TEST_IMAGE=${HOLADO_TEST_IMAGE_REGISTRY}:${HOLADO_TEST_IMAGE_TAG}
42
+ TEST_IMAGE=${HOLADO_IMAGE_REGISTRY}:${HOLADO_IMAGE_TAG}
43
43
 
44
44
  # Update docker image
45
45
  echo "Updating docker image ${TEST_IMAGE}..."
46
46
  docker pull ${TEST_IMAGE}
47
47
 
48
48
  # Define test output directory
49
- if [[ ! -z "$HOLADO_TEST_OUTPUT_BASEDIR" ]]; then
50
- OUTPUT_DIR=${HOLADO_TEST_OUTPUT_BASEDIR}
49
+ if [[ ! -z "$HOLADO_OUTPUT_BASEDIR" ]]; then
50
+ OUTPUT_DIR=${HOLADO_OUTPUT_BASEDIR}
51
51
  else
52
52
  OUTPUT_DIR=${WORK_DIR}/output
53
53
  fi
54
54
  echo "Output directory: $OUTPUT_DIR"
55
55
 
56
56
  # Define test resources directory
57
- if [[ ! -z "$HOLADO_TEST_LOCAL_RESOURCES_BASEDIR" ]]; then
58
- RESOURCES_DIR=${HOLADO_TEST_LOCAL_RESOURCES_BASEDIR}
57
+ if [[ ! -z "$HOLADO_LOCAL_RESOURCES_BASEDIR" ]]; then
58
+ RESOURCES_DIR=${HOLADO_LOCAL_RESOURCES_BASEDIR}
59
59
  else
60
60
  RESOURCES_DIR=${WORK_DIR}/resources
61
61
  fi
@@ -72,29 +72,29 @@ if [ ! -d ${RESOURCES_DIR} ]; then
72
72
  fi
73
73
 
74
74
  # Define container network
75
- if [ "$HOLADO_TEST_USE_LOCALHOST" = True ]; then
75
+ if [ "$HOLADO_USE_LOCALHOST" = True ]; then
76
76
  NETWORK_DEF_COMMAND="--network=host"
77
77
  else
78
- if [[ ! -z "$HOLADO_TEST_NETWORK" ]]; then
79
- NETWORK_DEF_COMMAND="--network $HOLADO_TEST_NETWORK"
78
+ if [[ ! -z "$HOLADO_NETWORK" ]]; then
79
+ NETWORK_DEF_COMMAND="--network $HOLADO_NETWORK"
80
80
  else
81
81
  NETWORK_DEF_COMMAND=""
82
82
  fi
83
83
  fi
84
84
 
85
85
  # Docker run
86
- if [[ -z "$HOLADO_TEST_RUNNER_NAME" ]]; then
87
- HOLADO_TEST_RUNNER_NAME=holado_test_runner
86
+ if [[ -z "$HOLADO_RUNNER_NAME" ]]; then
87
+ HOLADO_RUNNER_NAME=holado_test_runner
88
88
  fi
89
89
 
90
90
  echo
91
- echo "Running tests (docker name: ${HOLADO_TEST_RUNNER_NAME})..."
91
+ echo "Running tests (docker name: ${HOLADO_RUNNER_NAME})..."
92
92
  echo
93
- docker run --rm -it $((docker info | grep -i rootless > /dev/null && echo -n "--user root") || echo -n "-u $(id -u ${USER}):$(id -g ${USER})") --name ${HOLADO_TEST_RUNNER_NAME} \
93
+ docker run --rm -it $((docker info | grep -i rootless > /dev/null && echo -n "--user root") || echo -n "-u $(id -u ${USER}):$(id -g ${USER})") --name ${HOLADO_RUNNER_NAME} \
94
94
  -v "${OUTPUT_DIR}":/output \
95
95
  -v "${RESOURCES_DIR}":/resources \
96
- -e HOLADO_TEST_OUTPUT_BASEDIR=/output \
97
- -e HOLADO_TEST_LOCAL_RESOURCES_BASEDIR=/resources \
96
+ -e HOLADO_OUTPUT_BASEDIR=/output \
97
+ -e HOLADO_LOCAL_RESOURCES_BASEDIR=/resources \
98
98
  ${NETWORK_DEF_COMMAND} \
99
99
  -w /work_dir \
100
100
  ${TEST_IMAGE} /bin/bash