From c0619d427125a5818ead8c4b7048cb95116dd16d Mon Sep 17 00:00:00 2001 From: asteroide Date: Wed, 16 Dec 2015 16:16:47 +0100 Subject: Add log filenames in global outputs. Change-Id: I755ae05ae95d269b463ac347ef2a8dc527ab5693 --- moonclient/moonclient/tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/moonclient/moonclient/tests.py b/moonclient/moonclient/tests.py index 3bef6b9d..bace73af 100644 --- a/moonclient/moonclient/tests.py +++ b/moonclient/moonclient/tests.py @@ -81,20 +81,24 @@ class TestsLaunch(Lister): result_ok = True # self.log.info(result_id) # self.log.info(result_values[1]) + log_filename = "" for value in result_values[1]: if "False" in value[2]: result_ok = False - break + if "Overall results" in value[1]: + log_filename = value[3] if result_ok: - results.append((result_id, "\033[32mTrue\033[m")) + results.append((result_id, "\033[32mTrue\033[m", log_filename)) else: - results.append((result_id, "\033[1m\033[31mFalse\033[m")) + results.append((result_id, "\033[1m\033[31mFalse\033[m", log_filename)) return ( - ("filename", "results"), + ("filename", "results", "log file"), results ) def test_file(self, testfile): + self.logfile_name = "/tmp/moonclient_test_{}.log".format(time.strftime("%Y%m%d-%H%M%S")) + self.logfile = open(self.logfile_name, "w") stdout_back = self.app.stdout tests_dict = json.load(open(testfile)) self.log.debug("tests_dict = {}".format(tests_dict)) -- cgit 1.2.3-korg