Skip to content

Commit

Permalink
Return get_unique_path_for_current_test and some more (broken arcadia) (
Browse files Browse the repository at this point in the history
  • Loading branch information
maximyurchuk authored Nov 15, 2024
1 parent 91dd3b3 commit 16b2be5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ydb/tests/library/harness/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(
command,
cwd,
timeout,
stdout_file,
stderr_file,
stdout_file="/dev/null",
stderr_file="/dev/null",
stderr_on_error_lines=0,
core_pattern=None,
):
Expand Down
7 changes: 6 additions & 1 deletion ydb/tests/library/harness/kikimr_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ def __init__(

self.__dynamic_pdisks = dynamic_pdisks

self.__working_dir = output_path or yatest.common.test_output_path()
try:
test_path = yatest.common.test_output_path()
except Exception:
test_path = os.path.abspath("kikimr_working_dir")

self.__working_dir = output_path or test_path

if not os.path.isdir(self.__working_dir):
os.makedirs(self.__working_dir)
Expand Down
14 changes: 14 additions & 0 deletions ydb/tests/library/harness/kikimr_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
logger = logging.getLogger(__name__)


def get_unique_path_for_current_test(output_path, sub_folder):
# TODO: remove current function, don't rely on test environment, use explicit paths
# we can't remove it now, because it is used in Arcadia
import yatest.common
import os
try:
test_name = yatest.common.context.test_name or ""
except Exception:
test_name = ""

test_name = test_name.replace(':', '_')
return os.path.join(output_path, test_name, sub_folder)


def ensure_path_exists(path):
# NOTE: can't switch to os.makedirs(path, exist_ok=True) as some tests
# are still running under python2 (exist_ok was added in py3.2)
Expand Down

0 comments on commit 16b2be5

Please sign in to comment.