Trending: Generate email body for regressions and progressions 41/22641/5
authorTibor Frank <tifrank@cisco.com>
Thu, 10 Oct 2019 09:52:22 +0000 (11:52 +0200)
committerTibor Frank <tifrank@cisco.com>
Fri, 11 Oct 2019 09:57:09 +0000 (09:57 +0000)
Change-Id: Iee652fc48b574b7866d5e7f0b7b927f96de3d25f
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_CPTA.py
resources/tools/presentation/generator_alerts.py
resources/tools/presentation/specification_CPTA.yaml

index 580b8f0..f57757f 100644 (file)
@@ -602,6 +602,12 @@ def _generate_all_charts(spec, input_data):
                     if classification == "regression" or \
                             classification == "outlier":
                         result = "FAIL"
+            file_name = "{0}-progressions-{1}.txt".\
+                format(spec.cpta["output-file"], job_name)
+            with open(file_name, 'w') as txt_file:
+                for test_name, classification in job_data.iteritems():
+                    if classification == "progression":
+                        txt_file.write(test_name + '\n')
     else:
         result = "FAIL"
 
index 2c2b70d..a3689f3 100644 (file)
@@ -334,6 +334,15 @@ class Alerting(object):
                             link=alert["urls"][idx],
                             build=build,
                             version=version))
+            regression_hdr = ("\n\n{topo}-{arch}, "
+                              "CSIT build: {link}/{build}, "
+                              "VPP version: {version}\n\n"
+                              .format(topo=test_set.split('-')[-2],
+                                      arch=test_set.split('-')[-1],
+                                      link=alert["urls"][idx],
+                                      build=build,
+                                      version=version
+                                      ))
             max_len_name = 0
             max_len_nics = 0
             max_len_framesizes = 0
@@ -364,16 +373,37 @@ class Alerting(object):
 
             # Add list of regressions:
             file_name = "{0}/cpta-regressions-{1}.txt".\
-                format(config["output-dir"],
-                       alert["urls"][idx].split('/')[-1])
+                format(config["output-dir"], alert["urls"][idx].split('/')[-1])
             try:
                 with open(file_name, 'r') as txt_file:
                     file_content = txt_file.read()
-                    if file_content:
-                        text += "\nRegressions (full paths):\n\n"
-                        text += file_content
-            except IOError:
-                pass
+                    reg_file_name = "{dir}/trending-regressions.txt". \
+                        format(dir=config["output-dir"])
+                    with open(reg_file_name, 'a+') as reg_file:
+                        reg_file.write(regression_hdr)
+                        if file_content:
+                            reg_file.write(file_content)
+                        else:
+                            reg_file.write("No regressions")
+            except IOError as err:
+                logging.warning(repr(err))
+
+            # Add list of progressions:
+            file_name = "{0}/cpta-progressions-{1}.txt".\
+                format(config["output-dir"], alert["urls"][idx].split('/')[-1])
+            try:
+                with open(file_name, 'r') as txt_file:
+                    file_content = txt_file.read()
+                    pro_file_name = "{dir}/trending-progressions.txt". \
+                        format(dir=config["output-dir"])
+                    with open(pro_file_name, 'a+') as pro_file:
+                        pro_file.write(regression_hdr)
+                        if file_content:
+                            pro_file.write(file_content)
+                        else:
+                            pro_file.write("No progressions")
+            except IOError as err:
+                logging.warning(repr(err))
 
         text += "\nFor detailed information visit: {url}\n".\
             format(url=alert["url-details"])
index 7e46018..a08dda7 100644 (file)
     # 3n-hsw
     plot-performance-trending-all-3n-hsw:
       csit-vpp-perf-mrr-daily-master:
-        start: 770
+        start: 780
         end: "lastCompletedBuild"
         skip:
           - 781
 
     plot-performance-trending-vpp-3n-hsw:
       csit-vpp-perf-mrr-daily-master:
-        start: 770
+        start: 780
         end: "lastCompletedBuild"
         skip:
           - 781
     # 3n-skx
     plot-performance-trending-all-3n-skx:
       csit-vpp-perf-mrr-daily-master-3n-skx:
-        start: 520
+        start: 530
         end: "lastCompletedBuild"
         skip:
           - 531
 
     plot-performance-trending-vpp-3n-skx:
       csit-vpp-perf-mrr-daily-master-3n-skx:
-        start: 520
+        start: 530
         end: "lastCompletedBuild"
         skip:
           - 531
     # 2n-skx
     plot-performance-trending-all-2n-skx:
       csit-vpp-perf-mrr-daily-master-2n-skx:
-        start: 520
+        start: 530
         end: "lastCompletedBuild"
         skip:
           - 532
 
     plot-performance-trending-vpp-2n-skx:
       csit-vpp-perf-mrr-daily-master-2n-skx:
-        start: 520
+        start: 530
         end: "lastCompletedBuild"
         skip:
           - 532
 
     # 3n-hsw
     csit-vpp-perf-mrr-daily-master:
-      start: 770
+      start: 780
       end: "lastCompletedBuild"
       skip:
         - 781
 
     # 3n-skx
     csit-vpp-perf-mrr-daily-master-3n-skx:
-      start: 520
+      start: 530
       end: "lastCompletedBuild"
       skip:
         - 531
 
     # 2n-skx
     csit-vpp-perf-mrr-daily-master-2n-skx:
-      start: 520
+      start: 530
       end: "lastCompletedBuild"
       skip:
         - 532