Update on Functest reporting processing 09/27809/2
authorMorgan Richomme <morgan.richomme@orange.com>
Tue, 31 Jan 2017 17:24:30 +0000 (18:24 +0100)
committerMorgan Richomme <morgan.richomme@orange.com>
Mon, 6 Feb 2017 09:01:34 +0000 (10:01 +0100)
- new param to exclude or not results from virtual PODs
- new param to exclude or not noha results
- fix path
- add rally_sanity in black list until we fixed the format issue

Change-Id: Ie952f7d6968a322edbcf2effffbc1a75beddc52f
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
utils/test/reporting/functest/reporting-status.py
utils/test/reporting/reporting.yaml
utils/test/reporting/utils/reporting_utils.py

index 66bdd57..158ee59 100755 (executable)
@@ -40,6 +40,9 @@ versions = rp_utils.get_config('general.versions')
 installers = rp_utils.get_config('general.installers')
 blacklist = rp_utils.get_config('functest.blacklist')
 log_level = rp_utils.get_config('general.log.log_level')
+exclude_noha = rp_utils.get_config('functest.exclude_noha')
+exclude_virtual = rp_utils.get_config('functest.exclude_virtual')
+
 response = requests.get(cf)
 
 functest_yaml_config = yaml.safe_load(response.text)
@@ -48,7 +51,10 @@ logger.info("*******************************************")
 logger.info("*                                         *")
 logger.info("*   Generating reporting scenario status  *")
 logger.info("*   Data retention: %s days               *" % period)
-logger.info("*   Log level: %s                       *" % log_level)
+logger.info("*   Log level: %s                         *" % log_level)
+logger.info("*                                         *")
+logger.info("*   Virtual PODs exluded: %s              *" % exclude_virtual)
+logger.info("*   NOHA scenarios excluded: %s           *" % exclude_noha)
 logger.info("*                                         *")
 logger.info("*******************************************")
 
@@ -90,7 +96,6 @@ for version in versions:
         scenario_stats = rp_utils.getScenarioStats(scenario_results)
         items = {}
         scenario_result_criteria = {}
-
         scenario_file_name = ("./display/" + version +
                               "/functest/scenario_history.txt")
         # initiate scenario file if it does not exist
index fa98626..9db0890 100644 (file)
@@ -2,13 +2,13 @@ general:
     installers:
         - apex
         - compass
+        - daisy
         - fuel
         - joid
-        - daisy
 
     versions:
         - master
-        - colorado
+
     log:
         log_file: reporting.log
         log_level: ERROR
@@ -30,17 +30,19 @@ general:
 
 testapi:
     url: testresults.opnfv.org/test/api/v1/results
-    
+
 functest:
     blacklist:
         - ovno
         - security_scan
+        - rally_sanity
     max_scenario_criteria: 50
     test_conf: https://git.opnfv.org/cgit/functest/plain/functest/ci/testcases.yaml
     log_level: ERROR
-    jenkins_url: https://build.opnfv.org/ci/view/functest/job
-    
-    
+    jenkins_url: https://build.opnfv.org/ci/view/functest/job/
+    exclude_noha: False
+    exclude_virtual: True
+
 yardstick:
     test_conf: https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml
     log_level: ERROR
index 0af60c7..da97953 100644 (file)
@@ -127,7 +127,15 @@ def getScenarios(case, installer, version):
             # Retrieve all the scenarios per installer
             if not r['scenario'] in scenario_results.keys():
                 scenario_results[r['scenario']] = []
-            scenario_results[r['scenario']].append(r)
+            # Do we consider results from virtual pods ...
+            # Do we consider results for non HA scenarios...
+            exclude_virtual_pod = get_config('functest.exclude_virtual')
+            exclude_noha = get_config('functest.exclude_noha')
+            if ((exclude_virtual_pod and "virtual" in r['pod_name']) or
+               (exclude_noha and "noha" in r['scenario'])):
+                    print "exclude virtual pod results..."
+            else:
+                scenario_results[r['scenario']].append(r)
 
     return scenario_results
 
@@ -254,13 +262,14 @@ def getResult(testCase, installer, scenario, version):
 def getJenkinsUrl(build_tag):
     # e.g. jenkins-functest-apex-apex-daily-colorado-daily-colorado-246
     # id = 246
+    # jenkins-functest-compass-huawei-pod5-daily-master-136
+    # id = 136
     # note it is linked to jenkins format
     # if this format changes...function to be adapted....
     url_base = get_config('functest.jenkins_url')
     try:
         build_id = [int(s) for s in build_tag.split("-") if s.isdigit()]
-        jenkins_path = filter(lambda c: not c.isdigit(), build_tag)
-        url_id = jenkins_path[8:-1] + "/" + str(build_id[0])
+        url_id = build_tag[8:-(len(build_id)+3)] + "/" + str(build_id[0])
         jenkins_url = url_base + url_id + "/console"
     except:
         print 'Impossible to get jenkins url:'