aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-08-23 10:51:27 +0300
committeralexv-smirnov <alex@ydb.tech>2023-08-23 11:04:05 +0300
commit8bedeb58ada0550f8dce2b937b55ec7709b7a1f2 (patch)
tree904bcc356544c7614e3f6939f1b690d529c31149
parentf37f4e4ff7ae0673f471ef553def88e25c91b522 (diff)
downloadydb-8bedeb58ada0550f8dce2b937b55ec7709b7a1f2.tar.gz
Enable recipe to run with test env file name in the command line
-rw-r--r--library/python/testing/recipe/__init__.py3
-rw-r--r--library/python/testing/yatest_lib/ya.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/library/python/testing/recipe/__init__.py b/library/python/testing/recipe/__init__.py
index 483fe6a739..be5c956fd5 100644
--- a/library/python/testing/recipe/__init__.py
+++ b/library/python/testing/recipe/__init__.py
@@ -49,6 +49,7 @@ def get_options():
parser.add_argument("--build-root", type=str, dest="build_root", default=None, help="Build root directory")
parser.add_argument("--source-root", type=str, dest="source_root", default=None, help="Source root directory")
parser.add_argument("--output-dir", type=str, dest="output_dir", default=None, help="Output directory")
+ parser.add_argument("--env-file", type=str, dest="env_file", default=None, help="File to read/write environment variables")
args, opts = parser.parse_known_args()
@@ -59,7 +60,7 @@ def get_options():
"test_stderr": args.test_stderr,
}
- ya = Ya(context=context, build_root=args.build_root, source_root=args.source_root, output_dir=args.output_dir)
+ ya = Ya(context=context, build_root=args.build_root, source_root=args.source_root, output_dir=args.output_dir, env_file=args.env_file)
ya._data_root = "" # XXX remove
diff --git a/library/python/testing/yatest_lib/ya.py b/library/python/testing/yatest_lib/ya.py
index 607694e0c5..89a82b55a6 100644
--- a/library/python/testing/yatest_lib/ya.py
+++ b/library/python/testing/yatest_lib/ya.py
@@ -39,6 +39,7 @@ class Ya(object):
valgrind_path=None,
gdb_path=None,
data_root=None,
+ env_file=None,
):
context_file_path = os.environ.get("YA_TEST_CONTEXT_FILE", None)
if context_file_path:
@@ -101,7 +102,7 @@ class Ya(object):
self._context["sanitize"] = context_build.get("sanitizer")
self._context["ya_trace_path"] = context_internal.get("trace_file")
- self._env_file = context_internal.get("env_file")
+ self._env_file = context_internal.get("env_file") or env_file
if context:
for k, v in context.items():