aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2023-10-03 20:15:51 +0300
committeraneporada <aneporada@ydb.tech>2023-10-03 20:33:48 +0300
commitacf1c9574dfbfcaf8610b342711b0d9e38840ac0 (patch)
tree57263f4ab25f5a66ca5797cbf16fe2bd9f9347be
parentcfe3f631747c27cfc589563655cae8bfc127a614 (diff)
downloadydb-acf1c9574dfbfcaf8610b342711b0d9e38840ac0.tar.gz
Support custom gateways.conf in tests
-rw-r--r--ydb/library/yql/cfg/udf_test/gateways-forceblocks.conf13
-rw-r--r--ydb/library/yql/tests/common/test_framework/yql_utils.py13
-rw-r--r--ydb/library/yql/tests/common/test_framework/yqlrun.py2
3 files changed, 27 insertions, 1 deletions
diff --git a/ydb/library/yql/cfg/udf_test/gateways-forceblocks.conf b/ydb/library/yql/cfg/udf_test/gateways-forceblocks.conf
new file mode 100644
index 0000000000..927f4f5c87
--- /dev/null
+++ b/ydb/library/yql/cfg/udf_test/gateways-forceblocks.conf
@@ -0,0 +1,13 @@
+SqlCore {
+ TranslationFlags: ["FlexibleTypes", "DisableAnsiOptionalAs", "EmitAggApply"]
+}
+
+YqlCore {
+ Flags {
+ Name: "DisableYsonCastToString"
+ }
+ Flags {
+ Name: "UseBlocks"
+ }
+}
+
diff --git a/ydb/library/yql/tests/common/test_framework/yql_utils.py b/ydb/library/yql/tests/common/test_framework/yql_utils.py
index 40ab109c0a..5c37c63dba 100644
--- a/ydb/library/yql/tests/common/test_framework/yql_utils.py
+++ b/ydb/library/yql/tests/common/test_framework/yql_utils.py
@@ -36,6 +36,19 @@ def get_param(name, default=None):
return yatest.common.get_param(name, os.environ.get(name) or default)
+def get_gateway_cfg_suffix():
+ default_suffix = None
+ return get_param('gateway_config_suffix', default_suffix) or ''
+
+
+def get_gateway_cfg_filename():
+ suffix = get_gateway_cfg_suffix()
+ if suffix == '':
+ return 'gateways.conf'
+ else:
+ return 'gateways-' + suffix + '.conf'
+
+
def find_file(path):
arcadia_root = '.'
while '.arcadia.root' not in os.listdir(arcadia_root):
diff --git a/ydb/library/yql/tests/common/test_framework/yqlrun.py b/ydb/library/yql/tests/common/test_framework/yqlrun.py
index 5a5509f8e6..d4fad182c3 100644
--- a/ydb/library/yql/tests/common/test_framework/yqlrun.py
+++ b/ydb/library/yql/tests/common/test_framework/yqlrun.py
@@ -64,7 +64,7 @@ class YQLRun(object):
if cfg_dir is None:
cfg_dir = 'yql/cfg/tests'
- with open(yql_utils.yql_source_path(cfg_dir + '/gateways.conf')) as f:
+ with open(yql_utils.yql_source_path(cfg_dir + '/' + yql_utils.get_gateway_cfg_filename())) as f:
text_format.Merge(f.read(), self.gateway_config)
self.fs_config = file_storage_pb2.TFileStorageConfig()