Automatic style fix

This commit is contained in:
robot-clickhouse 2023-02-02 00:59:49 +00:00
parent 03109f942d
commit ddbc8ceee8
3 changed files with 11 additions and 4 deletions

View File

@ -88,8 +88,13 @@ def process_test_log(log_path):
# Python does not support TSV, so we have to escape '\t' and '\n' manually
# and hope that complex escape sequences will not break anything
test_results = [
(test[0], test[1], test[2],
"".join(test[3])[:4096].replace('\t', '\\t').replace('\n', '\\n')) for test in test_results
(
test[0],
test[1],
test[2],
"".join(test[3])[:4096].replace("\t", "\\t").replace("\n", "\\n"),
)
for test in test_results
]
return (

View File

@ -185,7 +185,7 @@ def prepare_tests_results_for_clickhouse(
current_row["test_status"] = test_status
if test_result.raw_logs:
# Protect from too big blobs that contain garbage
current_row["test_context_raw"] = test_result.raw_logs[:32 * 1024]
current_row["test_context_raw"] = test_result.raw_logs[: 32 * 1024]
else:
current_row["test_context_raw"] = ""
result.append(current_row)

View File

@ -225,7 +225,9 @@ def read_test_results(results_path: Path, with_raw_logs: bool = True) -> TestRes
# the 4th value is a pythonic list, e.g. ['file1', 'file2']
if with_raw_logs:
# Python does not support TSV, so we unescape manually
result.set_raw_logs(line[3]).replace('\\t', '\t').replace('\\n', '\n')
result.set_raw_logs(line[3]).replace("\\t", "\t").replace(
"\\n", "\n"
)
else:
result.set_log_files(line[3])