Fix too long logs dir for analyze logs

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2022-11-18 13:36:59 +03:00 committed by abereziny
parent 2140ce7f89
commit 4a9e3facff

View file

@ -96,7 +96,8 @@ def analyze_logs(prepare_tmp_dir: str, hosting: Hosting, request: FixtureRequest
with allure.step("Skip analyze logs due to no_log_analyze mark"):
return
logs_dir = os.path.join(prepare_tmp_dir, f"logs_{sanitize_for_file_name(request.node.name)}")
# Test name may exceed os NAME_MAX (255 bytes), so we use timestamp instead
logs_dir = os.path.join(prepare_tmp_dir, f"logs_{sanitize_for_file_name(start_time)}")
dump_logs(hosting, logs_dir, start_time, end_time)
check_logs(logs_dir)