skorotkov commented on code in PR #12309:
URL: https://github.com/apache/ignite/pull/12309#discussion_r2432008376


##########
modules/ducktests/tests/ignitetest/services/postgresql/postgresql.py:
##########
@@ -0,0 +1,196 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains classes and utilities to start PostgreSql cluster for 
testing CDC.
+"""
+
+import os.path
+from distutils.version import LooseVersion
+
+from ducktape.cluster.remoteaccount import RemoteCommandError
+from ducktape.utils.util import wait_until
+
+from ignitetest.services.utils.ducktests_service import DucktestsService
+from ignitetest.services.utils.ignite_spec import envs_to_exports
+from ignitetest.services.utils.log_utils import monitor_log
+from ignitetest.services.utils.path import PathAware
+
+
+class PostgresSettings:
+    """
+    Settings for PostgreSQL nodes.
+    """
+
+    def __init__(self, **kwargs):
+        self.port = kwargs.get("port", 5432)
+
+        version = kwargs.get("version")
+        if version:
+            if isinstance(version, str):
+                version = LooseVersion(version)
+            self.version = version
+        else:
+            self.version = LooseVersion("15.4")
+
+
+class PostgresService(DucktestsService, PathAware):
+    """
+    PostgreSQL service.
+    """
+    LOG_FILENAME = "postgresql.log"
+
+    def __init__(self, context, num_nodes, settings=PostgresSettings(), 
start_timeout_sec=30):
+        super().__init__(context, num_nodes)
+        self.settings = settings
+        self.start_timeout_sec = start_timeout_sec
+        self.init_logs_attribute()
+
+    @property
+    def product(self):
+        return "%s-%s" % ("postgres", self.settings.version)
+
+    @property
+    def globals(self):
+        return self.context.globals
+
+    @property
+    def log_config_file(self):
+        raise RuntimeError("Not implemented!")
+
+    @property
+    def config_file(self):
+        return os.path.join(self.work_dir, "postgresql.conf")

Review Comment:
   Please create the separate config subdirectory and create and use 
postgresql.conf file from there.
   
   See kafka or other services for references (look for the `self.config_dir`).
   
   Otherwide the test run results doesn't  contain config file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to