Merge 'test.py: fix cql failure handling' from Alecco

Fix a bug in failure handling and log level.

Closes #12336

* github.com:scylladb/scylladb:
  test.py: convert param to str
  test.py: fix error level for CQL tests
This commit is contained in:
Nadav Har'El
2022-12-16 09:29:21 +02:00

View File

@@ -675,7 +675,8 @@ class CQLApprovalTest(Test):
def set_summary(summary):
self.summary = summary
logging.info("Test %s %s", self.uname, summary)
log_func = logging.info if self.success else logging.error
log_func("Test %s %s", self.uname, summary)
if self.server_log is not None:
logging.info("Server log:\n%s", self.server_log)
@@ -703,7 +704,7 @@ Check test log at {}.""".format(self.log_filename))
else:
self.is_equal_result = filecmp.cmp(self.result, self.tmpfile)
if self.is_equal_result is False:
self.unidiff = format_unidiff(self.result, self.tmpfile)
self.unidiff = format_unidiff(str(self.result), self.tmpfile)
set_summary("failed: test output does not match expected result")
assert self.unidiff is not None
logging.info("\n{}".format(palette.nocolor(self.unidiff)))