From 86042d1d4bc886479259b14865ad220f1a8c8a1a Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Tue, 20 Dec 2016 15:00:20 +0100 Subject: [PATCH] Separating the test command from the other commands in the boards made by the jobs command --- commands/job.py | 3 ++- commands/jobs.py | 21 +++++++++++++++++++++ commands/test.py | 3 ++- src/xsl/jobs_board_report.xsl | 17 ++++++++++++++--- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/commands/job.py b/commands/job.py index 136e2ab..f27f7e7 100644 --- a/commands/job.py +++ b/commands/job.py @@ -155,7 +155,8 @@ def run(args, runner, logger): nb_pass += 1 logger.write('%s\n' % src.printcolors.printc(src.OK_STATUS), 3) else: - res = 1 + if sat_command_name != "test": + res = 1 logger.write('%s %s\n' % (src.printcolors.printc(src.KO_STATUS), error), 3) if len(stack) > 0: diff --git a/commands/jobs.py b/commands/jobs.py index 89fedbb..06602f2 100644 --- a/commands/jobs.py +++ b/commands/jobs.py @@ -1501,6 +1501,12 @@ class Gui(object): src.xmlManager.add_simple_node(xmlj, "remote_log_file_path", "nothing") + # Search for the test log if there is any + l_test_log_files = self.find_test_log(job.remote_log_files) + xml_test = src.xmlManager.add_simple_node(xmlj, + "test_log_file_path") + for test_log_path in l_test_log_files: + src.xmlManager.add_simple_node(xml_test, "path", test_log_path) xmlafter = src.xmlManager.add_simple_node(xmlj, "after", job.after) # get the job father @@ -1542,6 +1548,21 @@ class Gui(object): datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}) + def find_test_log(self, l_remote_log_files): + '''Find if there is a test log (board) in the remote log files and + the path to it. There can be several test command, so the result is + a list. + + :param l_remote_log_files List: the list of all remote log files + :return: the list of test log files path + :rtype: List + ''' + res = [] + for file_path in l_remote_log_files: + dirname = os.path.basename(os.path.dirname(file_path)) + if dirname == "TEST": + res.append(file_path) + return res def last_update(self, finish_status = "finished"): '''update information about the jobs for the file xml_file diff --git a/commands/test.py b/commands/test.py index 55c748b..9baf117 100644 --- a/commands/test.py +++ b/commands/test.py @@ -541,7 +541,8 @@ def run(args, runner, logger): retcode, "Click on the link to get the detailed test results") - logger.write(_("Removing the temporary directory: rm -rf %s\n" % test_runner.tmp_working_dir), 5) + logger.write(_("Removing the temporary directory: " + "rm -rf %s\n" % test_runner.tmp_working_dir), 5) if os.path.exists(test_runner.tmp_working_dir): shutil.rmtree(test_runner.tmp_working_dir) diff --git a/src/xsl/jobs_board_report.xsl b/src/xsl/jobs_board_report.xsl index dff9e39..9499a9b 100644 --- a/src/xsl/jobs_board_report.xsl +++ b/src/xsl/jobs_board_report.xsl @@ -233,7 +233,7 @@ - + - @@ -253,7 +253,18 @@ - + + + + - + + + remote log test + + test + + +
@@ -390,4 +401,4 @@ - \ No newline at end of file + -- 2.30.2