All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file
@ 2018-01-31  7:50 Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 2/9] common: add a generic function to split test outputs Liu Wenlong
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

Add log links for the tests which have separated log file,
Such as, Functional.LTP in the current Fuego.

The separated log link can help us to find the error log easily.
This feature indeed helped me a lot.

I also added link to "testlog.txt" for those tests who don't have the
separated log.(This might be a little unnecessary)

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/scripts/parser/prepare_chart_data.py | 33 +++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/engine/scripts/parser/prepare_chart_data.py b/engine/scripts/parser/prepare_chart_data.py
index af5f6d3..ffb042b 100644
--- a/engine/scripts/parser/prepare_chart_data.py
+++ b/engine/scripts/parser/prepare_chart_data.py
@@ -381,6 +381,8 @@ def cmp_alpha_num(a, b):
 def make_testcase_table(test_name, chart_config, entries):
     # make a table of testcase results for every testcase
     chart_list = []
+    jenkins_web_prefix = "/fuego"
+    jenkins_root_path = "/var/lib/jenkins/"
 
     # get a list of (board,test sets) in the data
     # FIXTHIS - use list of test sets in chart_config, if present
@@ -421,14 +423,32 @@ def make_testcase_table(test_name, chart_config, entries):
                 dprint("making a new row for '%s'" % row_key)
                 result_map[row_key] = {}
 
+            # entry.tguid: e.g. math.abs01.
+            tguid_parts = entry.tguid.split(".")
+            tguid_testset = ".".join(tguid_parts[:-1])
+            tguid_testcase = tguid_parts[-1]
+
+            # get the name that contains board, spec, build number. E.g. porter.default.1.1
+            log_bts_name = '%s.%s.%s.%s' % (entry.board, entry.spec, str(entry.build_number), str(entry.build_number))
+            # separated log files, e.g. /var/lib/jenkins/userContent/fuego.logs/Functional.LTP/ubuntu.math.7.7/result/math/outputs/abs01.log
+            log_file = '/userContent/fuego.logs/%s/%s/result/%s/outputs/%s.log' % (entry.testname, log_bts_name, tguid_testset, tguid_testcase)
+            # testlog files, e.g. /fuego/userContent/fuego.logs/Functional.croco/porter.default.${BUILD_NUMBER}.${BUILD_ID}/testlog.txt
+            testlog_file = '/userContent/fuego.logs/%s/%s/testlog.txt' % (entry.testname, log_bts_name)
+
+            # check if the separated log path exist
+            if os.path.exists(jenkins_root_path + log_file):
+                entry.result = '<a href=\"%s%s\">%s</a>' % (jenkins_web_prefix, log_file, entry.result)
+            elif os.path.exists(jenkins_root_path + testlog_file):
+                entry.result = '<a href=\"%s%s\">%s</a>' % (jenkins_web_prefix, testlog_file, entry.result)
+
             # add a data point (result) for this entry
             result_map[row_key][entry.build_number] = entry.result
             # count the result
-            if entry.result=="PASS":
+            if "PASS" in entry.result:
                 build_num_map[entry.build_number][0] += 1
-            elif entry.result=="FAIL":
+            elif "FAIL" in entry.result:
                 build_num_map[entry.build_number][1] += 1
-            elif entry.result=="SKIP":
+            elif "SKIP" in entry.result:
                 build_num_map[entry.build_number][2] += 1
             else:
                 build_num_map[entry.build_number][3] += 1
@@ -475,12 +495,13 @@ def make_testcase_table(test_name, chart_config, entries):
                     value = result_map[tc][bn]
                 except:
                     value = ""
-                if value=="PASS":
+                if "PASS" in value:
                     cell_attr = 'style="background-color:#ccffcc"'
-                elif value=="FAIL":
+                elif "FAIL" in value:
                     cell_attr = 'style="background-color:#ffcccc"'
                 else:
-                    cell_attr = ''
+                    cell_attr = 'align="center"'
+                    value='-'
                 row += ("<td %s>" % cell_attr) + value + "</td>"
             row += '</tr>'
             html += row
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 2/9] common: add a generic function to split test outputs
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 3/9] bzip2: add support that we can split the output for each testcase Liu Wenlong
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

Functional.LTP can split the test outputs to separated log file for each case.
Now, I add some links to those separated log files, which can help users to
check the error log for each case quickly, especially for those tests who had
heavy logs.

So, now I wanna to add this support for some Functional tests.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/scripts/parser/common.py | 64 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/engine/scripts/parser/common.py b/engine/scripts/parser/common.py
index 61f9d0c..5594fd5 100644
--- a/engine/scripts/parser/common.py
+++ b/engine/scripts/parser/common.py
@@ -605,6 +605,70 @@ def process_data(ref_section_pat, test_results, plot_type, label):
 
     return process(measurements)
 
+def make_dirs(dir_path):
+    if os.path.exists(dir_path):
+        return
+
+    try:
+        os.makedirs(dir_path)
+    except OSError:
+        pass
+
+def split_output_per_testcase (regex_string, measurements):
+    '''
+        For this Functional test, there is an testlog.txt file
+        that contains the output log of each testcase. This function
+        splits output.log into the log files of each case
+    '''
+    # open input
+    try:
+        output_all = open(TEST_LOG)
+    except IOError:
+        print('"%s" cannot be opened.' % TEST_LOG)
+
+    # prepare for outputs, the depth of the folder is the same as the LTP log files
+    result_dir = '%s/logs/%s/%s.%s.%s.%s/result' % (FUEGO_RW, TESTDIR, NODE_NAME, TESTSPEC, BUILD_NUMBER, BUILD_ID)
+    make_dirs(result_dir)
+
+    lines = output_all.readlines()
+    output_all.close()
+
+    in_loop = 0
+    test_index = 0
+    test_set = "default"
+    for line in lines:
+        if in_loop == 0:
+            if len(measurements) > test_index:
+                parts = measurements.keys()[test_index].split(".")
+                test_logfile = parts[-1]
+                test_set = ".".join(parts[:-1])
+            else:
+                test_logfile = "test_end"
+            in_loop = 1
+            test_index += 1
+
+            try:
+                out_dir = result_dir + '/%s/outputs' % test_set
+                make_dirs(out_dir)
+                output_each = open(out_dir+"/tmp.log", "w")
+            except IOError:
+                print('"%s" cannot be created or "%s/tmp.log" cannot be opened.' % (out_dir, out_dir))
+
+        if in_loop:
+            output_each.write("%s" % line)
+
+        m = re.compile(regex_string).match(line)
+        if m is not None:
+            in_loop = 0
+
+        if in_loop == 0:
+            output_each.close()
+            os.rename(out_dir+"/tmp.log", out_dir+"/%s.log" % test_logfile)
+
+    if in_loop == 1:
+        output_each.close()
+        os.rename(out_dir+"/tmp.log", out_dir+"/%s.log" % test_logfile)
+
 def main():
     pass
 
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 3/9] bzip2: add support that we can split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 2/9] common: add a generic function to split test outputs Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 4/9] curl: " Liu Wenlong
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

We can use those separated logs as the log link, which can help users
to check the log of those failures easily.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.bzip2/parser.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/engine/tests/Functional.bzip2/parser.py b/engine/tests/Functional.bzip2/parser.py
index 9e32eb3..f8a2bf4 100755
--- a/engine/tests/Functional.bzip2/parser.py
+++ b/engine/tests/Functional.bzip2/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -10,9 +10,13 @@ measurements = {}
 
 regex_string = '^TEST-(\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
 
 if matches:
     for m in matches:
         measurements['default.test' + m[0]] = 'PASS' if m[1] == 'OK' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
 sys.exit(plib.process(measurements))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 4/9] curl: add support that we can split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 2/9] common: add a generic function to split test outputs Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 3/9] bzip2: add support that we can split the output for each testcase Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 5/9] jpeg: " Liu Wenlong
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

We can use those separated logs as the log link, which can help users
to check the log of those failures easily.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.curl/parser.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/engine/tests/Functional.curl/parser.py b/engine/tests/Functional.curl/parser.py
index 9e32eb3..f8a2bf4 100755
--- a/engine/tests/Functional.curl/parser.py
+++ b/engine/tests/Functional.curl/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -10,9 +10,13 @@ measurements = {}
 
 regex_string = '^TEST-(\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
 
 if matches:
     for m in matches:
         measurements['default.test' + m[0]] = 'PASS' if m[1] == 'OK' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
 sys.exit(plib.process(measurements))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 5/9] jpeg: add support that we can split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
                   ` (2 preceding siblings ...)
  2018-01-31  7:50 ` [Fuego] [PATCH 4/9] curl: " Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 6/9] fuego_check tguid&tables: " Liu Wenlong
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

We can use those separated logs as the log link, which can help users
to check the log of those failures easily.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.jpeg/parser.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/engine/tests/Functional.jpeg/parser.py b/engine/tests/Functional.jpeg/parser.py
index 9e32eb3..f8a2bf4 100755
--- a/engine/tests/Functional.jpeg/parser.py
+++ b/engine/tests/Functional.jpeg/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -10,9 +10,13 @@ measurements = {}
 
 regex_string = '^TEST-(\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
 
 if matches:
     for m in matches:
         measurements['default.test' + m[0]] = 'PASS' if m[1] == 'OK' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
 sys.exit(plib.process(measurements))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 6/9] fuego_check tguid&tables: add support that we can split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
                   ` (3 preceding siblings ...)
  2018-01-31  7:50 ` [Fuego] [PATCH 5/9] jpeg: " Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 7/9] glibc: " Liu Wenlong
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

This test has multi-testsets and multi-testcases, it also can use the
generic function that we added before.
We can use those separated logs as the log link, which can help users
to check the log of those failures easily.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.fuego_check_tables/parser.py | 6 +++++-
 engine/tests/Functional.fuego_tguid_check/parser.py  | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/engine/tests/Functional.fuego_check_tables/parser.py b/engine/tests/Functional.fuego_check_tables/parser.py
index 6f55b21..3073e39 100755
--- a/engine/tests/Functional.fuego_check_tables/parser.py
+++ b/engine/tests/Functional.fuego_check_tables/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -11,6 +11,7 @@ measurements = {}
 # FIXTHIS - could do better TAP processing here
 regex_string = '^(ok|not ok) (\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
 
 print("TRB: matches = %s" % matches)
 
@@ -21,4 +22,7 @@ if matches:
         testcase = parts[1]
         measurements[test_set +'.' + testcase] = 'PASS' if m[0] == 'ok' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
 sys.exit(plib.process(measurements))
diff --git a/engine/tests/Functional.fuego_tguid_check/parser.py b/engine/tests/Functional.fuego_tguid_check/parser.py
index 6cccac6..145b84c 100755
--- a/engine/tests/Functional.fuego_tguid_check/parser.py
+++ b/engine/tests/Functional.fuego_tguid_check/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -10,6 +10,7 @@ results = {}
 
 regex_string = '^(ok|not ok) (\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+results = collections.OrderedDict()
 
 for m in matches:
     print("DEBUG: in parser.py: m=%s" % str(m))
@@ -18,4 +19,7 @@ for m in matches:
     test_id = m[2].replace(" ",".")
     results[test_id] = 'PASS' if status == 'ok' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, results)
+
 sys.exit(plib.process(results))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 7/9] glibc: add support that we can split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
                   ` (4 preceding siblings ...)
  2018-01-31  7:50 ` [Fuego] [PATCH 6/9] fuego_check tguid&tables: " Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 8/9] tiff: " Liu Wenlong
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

We can use those separated logs as the log link, which can help users
to check the log of those failures easily.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.glibc/parser.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/engine/tests/Functional.glibc/parser.py b/engine/tests/Functional.glibc/parser.py
index 9e32eb3..f8a2bf4 100755
--- a/engine/tests/Functional.glibc/parser.py
+++ b/engine/tests/Functional.glibc/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -10,9 +10,13 @@ measurements = {}
 
 regex_string = '^TEST-(\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
 
 if matches:
     for m in matches:
         measurements['default.test' + m[0]] = 'PASS' if m[1] == 'OK' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
 sys.exit(plib.process(measurements))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 8/9] tiff: add support that we can split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
                   ` (5 preceding siblings ...)
  2018-01-31  7:50 ` [Fuego] [PATCH 7/9] glibc: " Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-01-31  7:50 ` [Fuego] [PATCH 9/9] croco: add parser.py and " Liu Wenlong
  2018-02-01  1:43 ` [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Tim.Bird
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

This test has not been tested yet.
The untest reason is that my sdk cannot build Functional.tiff successfully.
However, the same code for other tests is OK and the Functional.tiff seems
to be not special with other jobs, so I just leave it here.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.tiff/parser.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/engine/tests/Functional.tiff/parser.py b/engine/tests/Functional.tiff/parser.py
index 9e32eb3..f8a2bf4 100755
--- a/engine/tests/Functional.tiff/parser.py
+++ b/engine/tests/Functional.tiff/parser.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # See common.py for description of command-line arguments
 
-import os, sys
+import os, sys, collections
 
 sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
@@ -10,9 +10,13 @@ measurements = {}
 
 regex_string = '^TEST-(\d+) (.*)$'
 matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
 
 if matches:
     for m in matches:
         measurements['default.test' + m[0]] = 'PASS' if m[1] == 'OK' else 'FAIL'
 
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
 sys.exit(plib.process(measurements))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Fuego] [PATCH 9/9] croco: add parser.py and split the output for each testcase
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
                   ` (6 preceding siblings ...)
  2018-01-31  7:50 ` [Fuego] [PATCH 8/9] tiff: " Liu Wenlong
@ 2018-01-31  7:50 ` Liu Wenlong
  2018-02-01  1:43 ` [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Tim.Bird
  8 siblings, 0 replies; 11+ messages in thread
From: Liu Wenlong @ 2018-01-31  7:50 UTC (permalink / raw)
  To: fuego

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
---
 engine/tests/Functional.croco/parser.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 engine/tests/Functional.croco/parser.py

diff --git a/engine/tests/Functional.croco/parser.py b/engine/tests/Functional.croco/parser.py
new file mode 100755
index 0000000..f8a2bf4
--- /dev/null
+++ b/engine/tests/Functional.croco/parser.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# See common.py for description of command-line arguments
+
+import os, sys, collections
+
+sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
+import common as plib
+
+measurements = {}
+
+regex_string = '^TEST-(\d+) (.*)$'
+matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
+
+if matches:
+    for m in matches:
+        measurements['default.test' + m[0]] = 'PASS' if m[1] == 'OK' else 'FAIL'
+
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
+sys.exit(plib.process(measurements))
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file
  2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
                   ` (7 preceding siblings ...)
  2018-01-31  7:50 ` [Fuego] [PATCH 9/9] croco: add parser.py and " Liu Wenlong
@ 2018-02-01  1:43 ` Tim.Bird
  2018-02-01  2:25   ` Liu, Wenlong
  8 siblings, 1 reply; 11+ messages in thread
From: Tim.Bird @ 2018-02-01  1:43 UTC (permalink / raw)
  To: liuwl.fnst, fuego



> -----Original Message-----
> From: Liu Wenlong
> 
> Add log links for the tests which have separated log file,
> Such as, Functional.LTP in the current Fuego.
> 
> The separated log link can help us to find the error log easily.
> This feature indeed helped me a lot.
> 
> I also added link to "testlog.txt" for those tests who don't have the
> separated log.(This might be a little unnecessary)
> 
> Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
> ---
>  engine/scripts/parser/prepare_chart_data.py | 33
> +++++++++++++++++++++++------
>  1 file changed, 27 insertions(+), 6 deletions(-)
> 
> diff --git a/engine/scripts/parser/prepare_chart_data.py
> b/engine/scripts/parser/prepare_chart_data.py
> index af5f6d3..ffb042b 100644
> --- a/engine/scripts/parser/prepare_chart_data.py
> +++ b/engine/scripts/parser/prepare_chart_data.py
> @@ -381,6 +381,8 @@ def cmp_alpha_num(a, b):
>  def make_testcase_table(test_name, chart_config, entries):
>      # make a table of testcase results for every testcase
>      chart_list = []
> +    jenkins_web_prefix = "/fuego"
I think we can probably use JENKINS_URL instead of this.

> +    jenkins_root_path = "/var/lib/jenkins/"

I'd rather we looked for these logs via the log directory,
than the jenkins directory.

> 
>      # get a list of (board,test sets) in the data
>      # FIXTHIS - use list of test sets in chart_config, if present
> @@ -421,14 +423,32 @@ def make_testcase_table(test_name, chart_config,
> entries):
>                  dprint("making a new row for '%s'" % row_key)
>                  result_map[row_key] = {}
> 
> +            # entry.tguid: e.g. math.abs01.
> +            tguid_parts = entry.tguid.split(".")
> +            tguid_testset = ".".join(tguid_parts[:-1])
> +            tguid_testcase = tguid_parts[-1]
> +
> +            # get the name that contains board, spec, build number. E.g.
> porter.default.1.1
> +            log_bts_name = '%s.%s.%s.%s' % (entry.board, entry.spec,
> str(entry.build_number), str(entry.build_number))
> +            # separated log files, e.g.
> /var/lib/jenkins/userContent/fuego.logs/Functional.LTP/ubuntu.math.7.7/re
> sult/math/outputs/abs01.log
This is relative to the URL home, not /var/lib/jenkins, for purposes of
this code.  This comment is misleading.

> +            log_file =
> '/userContent/fuego.logs/%s/%s/result/%s/outputs/%s.log' %
> (entry.testname, log_bts_name, tguid_testset, tguid_testcase)
> +            # testlog files, e.g.
> /fuego/userContent/fuego.logs/Functional.croco/porter.default.${BUILD_N
> UMBER}.${BUILD_ID}/testlog.txt
> +            testlog_file = '/userContent/fuego.logs/%s/%s/testlog.txt' %
> (entry.testname, log_bts_name)
> +
> +            # check if the separated log path exist
> +            if os.path.exists(jenkins_root_path + log_file):
> +                entry.result = '<a href=\"%s%s\">%s</a>' % (jenkins_web_prefix,
> log_file, entry.result)
> +            elif os.path.exists(jenkins_root_path + testlog_file):
> +                entry.result = '<a href=\"%s%s\">%s</a>' % (jenkins_web_prefix,
> testlog_file, entry.result)
> +
>              # add a data point (result) for this entry
>              result_map[row_key][entry.build_number] = entry.result
>              # count the result
> -            if entry.result=="PASS":
> +            if "PASS" in entry.result:
I'm not sure why this is needed.   The result in an entry in this code
should always be exactly one of FAIL, PASS, SKIP or ERROR.

Using python's 'in' shouldn't be needed, and is a more expensive
operation.   Did you see the use of '==' for this comparison fail
somewhere?  If so, that's a bug we should track down.

(The same comment applies to the rest of these conversions.)

>                  build_num_map[entry.build_number][0] += 1
> -            elif entry.result=="FAIL":
> +            elif "FAIL" in entry.result:
>                  build_num_map[entry.build_number][1] += 1
> -            elif entry.result=="SKIP":
> +            elif "SKIP" in entry.result:
>                  build_num_map[entry.build_number][2] += 1
>              else:
>                  build_num_map[entry.build_number][3] += 1
> @@ -475,12 +495,13 @@ def make_testcase_table(test_name, chart_config,
> entries):
>                      value = result_map[tc][bn]
>                  except:
>                      value = ""
> -                if value=="PASS":
> +                if "PASS" in value:
>                      cell_attr = 'style="background-color:#ccffcc"'
> -                elif value=="FAIL":
> +                elif "FAIL" in value:
>                      cell_attr = 'style="background-color:#ffcccc"'
>                  else:
> -                    cell_attr = ''
> +                    cell_attr = 'align="center"'
> +                    value='-'
>                  row += ("<td %s>" % cell_attr) + value + "</td>"
>              row += '</tr>'
>              html += row
> --
> 2.7.4

Thanks.
 -- Tim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file
  2018-02-01  1:43 ` [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Tim.Bird
@ 2018-02-01  2:25   ` Liu, Wenlong
  0 siblings, 0 replies; 11+ messages in thread
From: Liu, Wenlong @ 2018-02-01  2:25 UTC (permalink / raw)
  To: Tim.Bird, fuego

> -----Original Message-----
> From: Tim.Bird@sony.com [mailto:Tim.Bird@sony.com]
> Sent: Thursday, February 01, 2018 9:44 AM
> To: Liu, Wenlong/刘 文龙 <liuwl.fnst@cn.fujitsu.com>;
> fuego@lists.linuxfoundation.org
> Subject: RE: [Fuego] [PATCH 1/9] chart: add log links for the tests which
> have separated log file
> 
> > -----Original Message-----
> > From: Liu Wenlong
> >
> > Add log links for the tests which have separated log file, Such as,
> > Functional.LTP in the current Fuego.
> >
> > The separated log link can help us to find the error log easily.
> > This feature indeed helped me a lot.
> >
> > I also added link to "testlog.txt" for those tests who don't have the
> > separated log.(This might be a little unnecessary)
> >
> > Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
> > ---
> >  engine/scripts/parser/prepare_chart_data.py | 33
> > +++++++++++++++++++++++------
> >  1 file changed, 27 insertions(+), 6 deletions(-)
> >
> > diff --git a/engine/scripts/parser/prepare_chart_data.py
> > b/engine/scripts/parser/prepare_chart_data.py
> > index af5f6d3..ffb042b 100644
> > --- a/engine/scripts/parser/prepare_chart_data.py
> > +++ b/engine/scripts/parser/prepare_chart_data.py
> > @@ -381,6 +381,8 @@ def cmp_alpha_num(a, b):
> >  def make_testcase_table(test_name, chart_config, entries):
> >      # make a table of testcase results for every testcase
> >      chart_list = []
> > +    jenkins_web_prefix = "/fuego"
> I think we can probably use JENKINS_URL instead of this.
> 
> > +    jenkins_root_path = "/var/lib/jenkins/"
> 
> I'd rather we looked for these logs via the log directory, than the jenkins
> directory.

OK, I will change it.

> >
> >      # get a list of (board,test sets) in the data
> >      # FIXTHIS - use list of test sets in chart_config, if present @@
> > -421,14 +423,32 @@ def make_testcase_table(test_name, chart_config,
> > entries):
> >                  dprint("making a new row for '%s'" % row_key)
> >                  result_map[row_key] = {}
> >
> > +            # entry.tguid: e.g. math.abs01.
> > +            tguid_parts = entry.tguid.split(".")
> > +            tguid_testset = ".".join(tguid_parts[:-1])
> > +            tguid_testcase = tguid_parts[-1]
> > +
> > +            # get the name that contains board, spec, build number. E.g.
> > porter.default.1.1
> > +            log_bts_name = '%s.%s.%s.%s' % (entry.board, entry.spec,
> > str(entry.build_number), str(entry.build_number))
> > +            # separated log files, e.g.
> >
> /var/lib/jenkins/userContent/fuego.logs/Functional.LTP/ubuntu.math.7.7
> > /re
> > sult/math/outputs/abs01.log
> This is relative to the URL home, not /var/lib/jenkins, for purposes of
> this code.  This comment is misleading.
> 
> > +            log_file =
> > '/userContent/fuego.logs/%s/%s/result/%s/outputs/%s.log' %
> > (entry.testname, log_bts_name, tguid_testset, tguid_testcase)
> > +            # testlog files, e.g.
> >
> /fuego/userContent/fuego.logs/Functional.croco/porter.default.${BUILD_
> > N
> > UMBER}.${BUILD_ID}/testlog.txt
> > +            testlog_file =
> > + '/userContent/fuego.logs/%s/%s/testlog.txt' %
> > (entry.testname, log_bts_name)
> > +
> > +            # check if the separated log path exist
> > +            if os.path.exists(jenkins_root_path + log_file):
> > +                entry.result = '<a href=\"%s%s\">%s</a>' %
> > + (jenkins_web_prefix,
> > log_file, entry.result)
> > +            elif os.path.exists(jenkins_root_path + testlog_file):
> > +                entry.result = '<a href=\"%s%s\">%s</a>' %
> > + (jenkins_web_prefix,
> > testlog_file, entry.result)
> > +
>
> >              # add a data point (result) for this entry
> >              result_map[row_key][entry.build_number] = entry.result
> >              # count the result
> > -            if entry.result=="PASS":
> > +            if "PASS" in entry.result:
> I'm not sure why this is needed.   The result in an entry in this code
> should always be exactly one of FAIL, PASS, SKIP or ERROR.
> 
> Using python's 'in' shouldn't be needed, and is a more expensive
> operation.   Did you see the use of '==' for this comparison fail
> somewhere?  If so, that's a bug we should track down.

Emm, sorry, I changed the result in an entry above.
It's better to use a temporary variable to store this value which contains URL info.
And then, "==" will be ok here.

I will improve those patches together after your review.

> (The same comment applies to the rest of these conversions.)
> 
> >                  build_num_map[entry.build_number][0] += 1
> > -            elif entry.result=="FAIL":
> > +            elif "FAIL" in entry.result:
> >                  build_num_map[entry.build_number][1] += 1
> > -            elif entry.result=="SKIP":
> > +            elif "SKIP" in entry.result:
> >                  build_num_map[entry.build_number][2] += 1
> >              else:
> >                  build_num_map[entry.build_number][3] += 1 @@ -475,12
> > +495,13 @@ def make_testcase_table(test_name, chart_config,
> > entries):
> >                      value = result_map[tc][bn]
> >                  except:
> >                      value = ""
> > -                if value=="PASS":
> > +                if "PASS" in value:

But for this "value" here, it contains the the URL info and not aways be the one of FAIL, PASS, SKIP or ERROR.

> >                      cell_attr = 'style="background-color:#ccffcc"'
> > -                elif value=="FAIL":
> > +                elif "FAIL" in value:
> >                      cell_attr = 'style="background-color:#ffcccc"'
> >                  else:
> > -                    cell_attr = ''
> > +                    cell_attr = 'align="center"'
> > +                    value='-'
> >                  row += ("<td %s>" % cell_attr) + value + "</td>"
> >              row += '</tr>'
> >              html += row
> > --
> > 2.7.4
> 
> Thanks.
>  -- Tim
> 




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-02-01  2:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31  7:50 [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 2/9] common: add a generic function to split test outputs Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 3/9] bzip2: add support that we can split the output for each testcase Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 4/9] curl: " Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 5/9] jpeg: " Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 6/9] fuego_check tguid&tables: " Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 7/9] glibc: " Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 8/9] tiff: " Liu Wenlong
2018-01-31  7:50 ` [Fuego] [PATCH 9/9] croco: add parser.py and " Liu Wenlong
2018-02-01  1:43 ` [Fuego] [PATCH 1/9] chart: add log links for the tests which have separated log file Tim.Bird
2018-02-01  2:25   ` Liu, Wenlong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.