aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing/yatest_lib/ya.py
diff options
context:
space:
mode:
authorprettyboy <prettyboy@yandex-team.com>2023-05-24 13:32:24 +0300
committerprettyboy <prettyboy@yandex-team.com>2023-05-24 13:32:24 +0300
commit8059eca4138733f8a359688ab025dcca665822b3 (patch)
tree40dabb6d253e80aea6d9c2a20874beac0870e38f /library/python/testing/yatest_lib/ya.py
parent7179ba7ca682cded8bda94bd1bfa9cf887821c1c (diff)
downloadydb-8059eca4138733f8a359688ab025dcca665822b3.tar.gz
[devtools/ya/test] Fixed missing diff_tool dep and use build root relative paths
Diffstat (limited to 'library/python/testing/yatest_lib/ya.py')
-rw-r--r--library/python/testing/yatest_lib/ya.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/python/testing/yatest_lib/ya.py b/library/python/testing/yatest_lib/ya.py
index 0b48fcd03a..607694e0c5 100644
--- a/library/python/testing/yatest_lib/ya.py
+++ b/library/python/testing/yatest_lib/ya.py
@@ -180,7 +180,23 @@ class Ya(object):
if self._mode == RunMode.Run:
raise TestMisconfigurationException(error_message)
+ def _build_root_rel(self, path):
+ real_build_root = os.path.realpath(self.build_root)
+ real_path = os.path.abspath(path)
+ if path.startswith(real_build_root):
+ return os.path.relpath(real_path, real_build_root)
+ return path
+
def file(self, path, diff_tool=None, local=False, diff_file_name=None, diff_tool_timeout=None):
+ if diff_tool:
+ if isinstance(diff_tool, tuple):
+ diff_tool = list(diff_tool)
+ # Normalize path to diff_tool - abs path in run_test node won't be accessible in canonize node
+ if isinstance(diff_tool, list):
+ diff_tool[0] = self._build_root_rel(diff_tool[0])
+ else:
+ diff_tool = self._build_root_rel(diff_tool)
+
return ExternalDataInfo.serialize_file(path, diff_tool=diff_tool, local=local, diff_file_name=diff_file_name, diff_tool_timeout=diff_tool_timeout)
def get_param(self, key, default=None):