diff options
author | Ruan HE <ruan.he@orange.com> | 2015-12-16 17:02:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-12-16 17:02:38 +0000 |
commit | b47811869e3729a89ca3d936de8de89f73f2f891 (patch) | |
tree | 5b653b5c17a9c3a6010e79ee1612d935045e56ec /moonclient | |
parent | cfc4f82c40daf87920ae2f6d87ba0f9bb06c1f77 (diff) | |
parent | c0619d427125a5818ead8c4b7048cb95116dd16d (diff) |
Merge "Add log filenames in global outputs."
Diffstat (limited to 'moonclient')
-rw-r--r-- | moonclient/moonclient/tests.py | 12 |
1 files 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)) |