Repository: exasol/integration-test-docker-environment (language: python)

Issue:
The test_container_content parameter pollutes the logs
# Background

- Our luigi tasks will print the parameter of a task during logging
- Parameter defined with visibility=ParameterVisibility.HIDDEN will not be printed

# Acceptance Criteria

- Make the test_container_content parameter hidden


Discussion / hints:

Fix patch:
diff --git a/doc/changes/changes_1.6.0.md b/doc/changes/changes_1.6.0.md
index da09343fe..7e48d68fe 100644
--- a/doc/changes/changes_1.6.0.md
+++ b/doc/changes/changes_1.6.0.md
@@ -12,4 +12,9 @@ t.b.d.
 If you need further versions, please open an issue.
 
 ## Internal
- - #297: Update release_config.yml 
\ No newline at end of file
+ - #297: Update release_config.yml 
+
+## Changes
+
+ - #294: Fixed that the client logging config gets overwritten
+ - #295: Fixed that the test_container_content parameter pollutes the logs 
\ No newline at end of file


Test patch:
diff --git a/exasol_integration_test_docker_environment/lib/test_environment/analyze_test_container.py b/exasol_integration_test_docker_environment/lib/test_environment/analyze_test_container.py
index ed9b335c9..a017607d3 100644
--- a/exasol_integration_test_docker_environment/lib/test_environment/analyze_test_container.py
+++ b/exasol_integration_test_docker_environment/lib/test_environment/analyze_test_container.py
@@ -1,5 +1,7 @@
 from typing import Set, Dict
 
+from luigi.parameter import ParameterVisibility
+
 from exasol_integration_test_docker_environment.lib.base.json_pickle_parameter import JsonPickleParameter
 from exasol_integration_test_docker_environment.lib.config.docker_config import target_docker_repository_config, \
     source_docker_repository_config
@@ -11,10 +13,11 @@
 from exasol_integration_test_docker_environment.lib.docker.images.push.docker_push_parameter import DockerPushParameter
 from exasol_integration_test_docker_environment.lib.docker.images.push.push_task_creator_for_build_tasks import \
     PushTaskCreatorFromBuildTasks
+from exasol_integration_test_docker_environment.lib.test_environment.parameter.test_container_parameter import \
+    TestContainerParameter
 
 
-class AnalyzeTestContainer(DockerAnalyzeImageTask):
-    test_container_content = JsonPickleParameter(TestContainerContentDescription)
+class AnalyzeTestContainer(DockerAnalyzeImageTask, TestContainerParameter):
 
     def get_target_repository_name(self) -> str:
         return f"""{target_docker_repository_config().repository_name}"""
@@ -45,9 +48,7 @@ def is_rebuild_requested(self) -> bool:
         return False
 
 
-class DockerTestContainerBuildBase(DockerBuildBase):
-
-    test_container_content = JsonPickleParameter(TestContainerContentDescription)
+class DockerTestContainerBuildBase(DockerBuildBase, TestContainerParameter):
 
     def get_goal_class_map(self) -> Dict[str, DockerAnalyzeImageTask]:
         goal_class_map = {"test-container": self.create_child_task(task_class=AnalyzeTestContainer,
diff --git a/exasol_integration_test_docker_environment/lib/test_environment/parameter/general_spawn_test_environment_parameter.py b/exasol_integration_test_docker_environment/lib/test_environment/parameter/general_spawn_test_environment_parameter.py
index b78de41d7..8473b869b 100644
--- a/exasol_integration_test_docker_environment/lib/test_environment/parameter/general_spawn_test_environment_parameter.py
+++ b/exasol_integration_test_docker_environment/lib/test_environment/parameter/general_spawn_test_environment_parameter.py
@@ -1,13 +1,11 @@
 import luigi
 from luigi import Config
 
-from exasol_integration_test_docker_environment.lib.base.json_pickle_parameter import JsonPickleParameter
-from exasol_integration_test_docker_environment.lib.data.test_container_content_description import \
-    TestContainerContentDescription
+from exasol_integration_test_docker_environment.lib.test_environment.parameter.test_container_parameter import \
+    OptionalTestContainerParameter
 
 
-class GeneralSpawnTestEnvironmentParameter(Config):
-
+class GeneralSpawnTestEnvironmentParameter(OptionalTestContainerParameter):
     reuse_database_setup = luigi.BoolParameter(False, significant=False)
     reuse_test_container = luigi.BoolParameter(False, significant=False)
     no_test_container_cleanup_after_success = luigi.BoolParameter(False, significant=False)
@@ -15,5 +13,4 @@ class GeneralSpawnTestEnvironmentParameter(Config):
     max_start_attempts = luigi.IntParameter(2, significant=False)
     docker_runtime = luigi.OptionalParameter(None, significant=False)
     create_certificates = luigi.BoolParameter()
-    test_container_content = JsonPickleParameter(TestContainerContentDescription, is_optional=True)
     additional_db_parameter = luigi.ListParameter()
diff --git a/exasol_integration_test_docker_environment/lib/test_environment/parameter/test_container_parameter.py b/exasol_integration_test_docker_environment/lib/test_environment/parameter/test_container_parameter.py
new file mode 100644
index 000000000..52675552d
--- /dev/null
+++ b/exasol_integration_test_docker_environment/lib/test_environment/parameter/test_container_parameter.py
@@ -0,0 +1,16 @@
+from luigi.parameter import ParameterVisibility
+
+from exasol_integration_test_docker_environment.lib.base.json_pickle_parameter import JsonPickleParameter
+from exasol_integration_test_docker_environment.lib.data.test_container_content_description import \
+    TestContainerContentDescription
+
+
+class TestContainerParameter:
+    test_container_content = JsonPickleParameter(TestContainerContentDescription,
+                                                 visibility=ParameterVisibility.HIDDEN)
+
+
+class OptionalTestContainerParameter:
+    test_container_content = JsonPickleParameter(TestContainerContentDescription,
+                                                 visibility=ParameterVisibility.HIDDEN,
+                                                 is_optional=True)
diff --git a/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_container.py b/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_container.py
index 359d1e03f..3803eec7a 100644
--- a/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_container.py
+++ b/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_container.py
@@ -11,16 +11,16 @@
 from exasol_integration_test_docker_environment.lib.base.json_pickle_parameter import JsonPickleParameter
 from exasol_integration_test_docker_environment.lib.data.container_info import ContainerInfo
 from exasol_integration_test_docker_environment.lib.data.docker_network_info import DockerNetworkInfo
-from exasol_integration_test_docker_environment.lib.data.test_container_content_description import \
-    TestContainerContentDescription
 from exasol_integration_test_docker_environment.lib.docker.images.image_info import ImageState, ImageInfo
 from exasol_integration_test_docker_environment.lib.test_environment.analyze_test_container import \
     DockerTestContainerBuild
 from exasol_integration_test_docker_environment.lib.test_environment.docker_container_copy import \
     copy_script_to_container
+from exasol_integration_test_docker_environment.lib.test_environment.parameter.test_container_parameter import \
+    TestContainerParameter
 
 
-class SpawnTestContainer(DockerBaseTask):
+class SpawnTestContainer(DockerBaseTask, TestContainerParameter):
     environment_name = luigi.Parameter()
     test_container_name = luigi.Parameter()
     network_info = JsonPickleParameter(
@@ -32,7 +32,6 @@ class SpawnTestContainer(DockerBaseTask):
     no_test_container_cleanup_after_failure = luigi.BoolParameter(False, significant=False)
     docker_runtime = luigi.OptionalParameter(None, significant=False)
     certificate_volume_name = luigi.OptionalParameter(None, significant=False)
-    test_container_content = JsonPickleParameter(TestContainerContentDescription)
 
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
diff --git a/exasol_integration_test_docker_environment/test/test_test_container_reuse.py b/exasol_integration_test_docker_environment/test/test_test_container_reuse.py
index b97a32225..c1a65c92d 100644
--- a/exasol_integration_test_docker_environment/test/test_test_container_reuse.py
+++ b/exasol_integration_test_docker_environment/test/test_test_container_reuse.py
@@ -8,21 +8,21 @@
 from exasol_integration_test_docker_environment.lib.api.common import set_build_config, set_docker_repository_config, \
     generate_root_task
 from exasol_integration_test_docker_environment.lib.base.docker_base_task import DockerBaseTask
-from exasol_integration_test_docker_environment.lib.base.json_pickle_parameter import JsonPickleParameter
 from exasol_integration_test_docker_environment.lib.data.container_info import ContainerInfo
 from exasol_integration_test_docker_environment.lib.data.test_container_content_description import \
     TestContainerContentDescription
 from exasol_integration_test_docker_environment.lib.docker import ContextDockerClient
+from exasol_integration_test_docker_environment.lib.test_environment.parameter.test_container_parameter import \
+    TestContainerParameter
 from exasol_integration_test_docker_environment.lib.test_environment.prepare_network_for_test_environment import \
     PrepareDockerNetworkForTestEnvironment
 from exasol_integration_test_docker_environment.lib.test_environment.spawn_test_container import SpawnTestContainer
 from exasol_integration_test_docker_environment.testing import luigi_utils
 
 
-class TestTask(DockerBaseTask):
+class TestTask(DockerBaseTask, TestContainerParameter):
     reuse = luigi.BoolParameter()
     attempt = luigi.IntParameter()
-    test_container_content = JsonPickleParameter(TestContainerContentDescription)
 
     def run_task(self):
         docker_network_task_1 = self.create_child_task(task_class=PrepareDockerNetworkForTestEnvironment,