Skip to content

Commit 16b2be5

Browse files
authored
Return get_unique_path_for_current_test and some more (broken arcadia) (#11598)
1 parent 91dd3b3 commit 16b2be5

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

ydb/tests/library/harness/daemon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def __init__(
5858
command,
5959
cwd,
6060
timeout,
61-
stdout_file,
62-
stderr_file,
61+
stdout_file="/dev/null",
62+
stderr_file="/dev/null",
6363
stderr_on_error_lines=0,
6464
core_pattern=None,
6565
):

ydb/tests/library/harness/kikimr_config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ def __init__(
220220

221221
self.__dynamic_pdisks = dynamic_pdisks
222222

223-
self.__working_dir = output_path or yatest.common.test_output_path()
223+
try:
224+
test_path = yatest.common.test_output_path()
225+
except Exception:
226+
test_path = os.path.abspath("kikimr_working_dir")
227+
228+
self.__working_dir = output_path or test_path
224229

225230
if not os.path.isdir(self.__working_dir):
226231
os.makedirs(self.__working_dir)

ydb/tests/library/harness/kikimr_runner.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@
2424
logger = logging.getLogger(__name__)
2525

2626

27+
def get_unique_path_for_current_test(output_path, sub_folder):
28+
# TODO: remove current function, don't rely on test environment, use explicit paths
29+
# we can't remove it now, because it is used in Arcadia
30+
import yatest.common
31+
import os
32+
try:
33+
test_name = yatest.common.context.test_name or ""
34+
except Exception:
35+
test_name = ""
36+
37+
test_name = test_name.replace(':', '_')
38+
return os.path.join(output_path, test_name, sub_folder)
39+
40+
2741
def ensure_path_exists(path):
2842
# NOTE: can't switch to os.makedirs(path, exist_ok=True) as some tests
2943
# are still running under python2 (exist_ok was added in py3.2)

0 commit comments

Comments
 (0)