Salome HOME
Separating the test command from the other commands in the boards made by the jobs...
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Tue, 20 Dec 2016 14:00:20 +0000 (15:00 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Tue, 20 Dec 2016 14:00:20 +0000 (15:00 +0100)
commands/job.py
commands/jobs.py
commands/test.py
src/xsl/jobs_board_report.xsl

index 136e2ab740d79debc26a8c590ffef5fd9da1fc11..f27f7e733363ba4b6dde398d9517f092f75fa878 100644 (file)
@@ -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:
index 89fedbb5f210e4f22bbf6609e806ee6b08941639..06602f2d941364c37cd0c457a26ed23b023b8936 100644 (file)
@@ -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   
index 55c748b0304b5d7a152825951bda282e7433959c..9baf117d2243642a22d2a8c06231db8d05ffb441 100644 (file)
@@ -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)
 
index dff9e3946bbf36dd576855f7aff2acb967a3ba6f..9499a9ba0559306ead74f12dc54d623b8623024f 100644 (file)
                                </xsl:if>
                            </a>
                      </xsl:if>
-                     <xsl:if test="state/.='Not today'">
+                   <xsl:if test="state/.='Not today'">
                         - 
                        <xsl:for-each select="//JobsReport/jobs/job[@name=$curr_job_name]/history/link">
                        <xsl:sort select="@date" order="descending" />
                          </h4>
                        </xsl:if> 
                        </xsl:for-each>
-                     </xsl:if> 
+                     </xsl:if>
+              <!--Add the link to the tests if there is any -->
+              <xsl:if test="(test_log_file_path) and (test_log_file_path/*)">
+              -     
+                <xsl:for-each select="//JobsReport/jobs/job[@name=$curr_job_name]/test_log_file_path/path">
+                  <a>
+                                 <xsl:attribute name="title">remote log test</xsl:attribute>
+                                 <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
+                      test
+                  </a>
+                </xsl:for-each>
+                     </xsl:if>              
                      <br/>
                      
 
 
 </html>
 </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>