This is an automated email from the ASF dual-hosted git repository.

blambov pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git

commit f41ee663f4e79d4adc5ae5e02d39b75478908115
Author: Branimir Lambov <branimir.lam...@datastax.com>
AuthorDate: Wed Nov 22 12:57:52 2023 +0200

    Add support for specifying the name of the file to use as cassandra YAML.
    
    patch by Branimir Lambov; reviewed by Mick Semb Wever for CASSANDRA-18753
---
 conftest.py     | 2 ++
 dtest_config.py | 2 ++
 dtest_setup.py  | 2 ++
 run_dtests.py   | 1 +
 4 files changed, 7 insertions(+)

diff --git a/conftest.py b/conftest.py
index ef3a9d47..620857a3 100644
--- a/conftest.py
+++ b/conftest.py
@@ -50,6 +50,8 @@ def pytest_addoption(parser):
                      help="Determines wither or not to setup clusters using 
vnodes for tests")
     parser.addoption("--use-off-heap-memtables", action="store_true", 
default=False,
                      help="Enable Off Heap Memtables when creating test 
clusters for tests")
+    parser.addoption("--configuration-yaml", action="store", default=None,
+                     help="The name of the cassandra configuration YAML (e.g. 
cassandra_latest.yaml)")
     parser.addoption("--num-tokens", action="store", default=256,
                      help="Number of tokens to set num_tokens yaml setting to 
when creating instances "
                           "with vnodes enabled")
diff --git a/dtest_config.py b/dtest_config.py
index 86e8c96b..5d7cc0e5 100644
--- a/dtest_config.py
+++ b/dtest_config.py
@@ -12,6 +12,7 @@ logger = logging.getLogger(__name__)
 class DTestConfig:
     def __init__(self):
         self.use_vnodes = True
+        self.configuration_yaml = None
         self.use_off_heap_memtables = False
         self.num_tokens = -1
         self.data_dir_count = -1
@@ -42,6 +43,7 @@ class DTestConfig:
             return
 
         self.use_vnodes = config.getoption("--use-vnodes")
+        self.configuration_yaml = config.getoption("--configuration-yaml")
         self.use_off_heap_memtables = 
config.getoption("--use-off-heap-memtables")
         self.num_tokens = config.getoption("--num-tokens")
         self.data_dir_count = config.getoption("--data-dir-count-per-instance")
diff --git a/dtest_setup.py b/dtest_setup.py
index 2512f132..3980259b 100644
--- a/dtest_setup.py
+++ b/dtest_setup.py
@@ -474,6 +474,8 @@ class DTestSetup(object):
 
         if self.dtest_config.use_off_heap_memtables:
             
self.cluster.set_configuration_options(values={'memtable_allocation_type': 
'offheap_objects'})
+        if self.dtest_config.configuration_yaml is not None:
+            
self.cluster.set_configuration_yaml(self.dtest_config.configuration_yaml)
 
         self.cluster.set_configuration_options(values)
         logger.debug("Done setting configuration options:\n" + 
pprint.pformat(self.cluster._config_options, indent=4))
diff --git a/run_dtests.py b/run_dtests.py
index b8eed9c7..0f24443d 100755
--- a/run_dtests.py
+++ b/run_dtests.py
@@ -28,6 +28,7 @@ optional arguments:
   --dtest-print-tests-output=DTEST_PRINT_TESTS_OUTPUT        Path to file 
where the output of --dtest-print-tests-only should be written to (default: 
False)
   --pytest-options=PYTEST_OPTIONS                            Additional 
command line arguments to proxy directly thru when invoking pytest. (default: 
None)
   --dtest-tests=DTEST_TESTS                                  Comma separated 
list of test files, test classes, or test methods to execute. (default: None)
+  --configuration-yaml=CONFIG_FILE                           The name of the 
cassandra configuration YAML (e.g. cassandra_latest.yaml) (default: None)
 """
 import subprocess
 import sys


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to