From 5142d80bb12c1e94b9045883886504f2f9ac207f Mon Sep 17 00:00:00 2001 From: Alejo Sanchez Date: Thu, 15 Dec 2022 17:44:46 +0100 Subject: [PATCH 1/2] test.py: fix error level for CQL tests If the test fails, use error log level. Signed-off-by: Alejo Sanchez --- test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index c777835650..d8eb3b7d90 100755 --- a/test.py +++ b/test.py @@ -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) From 9b65448d38bd39a94173902c0afa117362fd44d4 Mon Sep 17 00:00:00 2001 From: Alejo Sanchez Date: Thu, 15 Dec 2022 17:47:12 +0100 Subject: [PATCH 2/2] test.py: convert param to str The format_unidiff() function takes str, not pathlib PosixPath, so convert it to str. This prevented diff output of unexpected result to be shown in the log file. Signed-off-by: Alejo Sanchez --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index d8eb3b7d90..eda7cbf3bd 100755 --- a/test.py +++ b/test.py @@ -704,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)))