diff options
Diffstat (limited to 'utils/test/reporting/functest')
-rwxr-xr-x | utils/test/reporting/functest/reporting-status.py | 118 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-tempest.py | 37 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-vims.py | 35 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingConf.py | 26 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingUtils.py | 186 | ||||
-rw-r--r-- | utils/test/reporting/functest/template/index-status-tmpl.html | 26 | ||||
-rw-r--r-- | utils/test/reporting/functest/template/index-tempest-tmpl.html | 12 | ||||
-rw-r--r-- | utils/test/reporting/functest/template/index-vims-tmpl.html | 12 | ||||
-rw-r--r-- | utils/test/reporting/functest/testCase.py | 4 |
9 files changed, 128 insertions, 328 deletions
diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py index 653448eaf..cb13b099c 100755 --- a/utils/test/reporting/functest/reporting-status.py +++ b/utils/test/reporting/functest/reporting-status.py @@ -8,19 +8,20 @@ # import datetime import jinja2 -import pdfkit +import os import requests import sys import time import yaml -import reportingUtils as utils -import reportingConf as conf import testCase as tc import scenarioResult as sr +# manage conf +import utils.reporting_utils as rp_utils + # Logger -logger = utils.getLogger("Status") +logger = rp_utils.getLogger("Functest-Status") # Initialization testValid = [] @@ -33,14 +34,21 @@ tempest = tc.TestCase("tempest_smoke_serial", "functest", -1) # Retrieve the Functest configuration to detect which tests are relevant # according to the installer, scenario -cf = conf.TEST_CONF +cf = rp_utils.get_config('functest.test_conf') +period = rp_utils.get_config('general.period') +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') response = requests.get(cf) functest_yaml_config = yaml.safe_load(response.text) logger.info("*******************************************") +logger.info("* *") logger.info("* Generating reporting scenario status *") -logger.info("* Data retention = %s days *" % conf.PERIOD) +logger.info("* Data retention: %s days *" % period) +logger.info("* Log level: %s *" % log_level) logger.info("* *") logger.info("*******************************************") @@ -55,36 +63,41 @@ config_tiers = functest_yaml_config.get("tiers") for tier in config_tiers: if tier['order'] > 0 and tier['order'] < 3: for case in tier['testcases']: - if case['name'] not in conf.blacklist: + if case['name'] not in blacklist: testValid.append(tc.TestCase(case['name'], "functest", case['dependencies'])) elif tier['order'] == 3: for case in tier['testcases']: - if case['name'] not in conf.blacklist: + if case['name'] not in blacklist: testValid.append(tc.TestCase(case['name'], case['name'], case['dependencies'])) elif tier['order'] > 3: for case in tier['testcases']: - if case['name'] not in conf.blacklist: + if case['name'] not in blacklist: otherTestCases.append(tc.TestCase(case['name'], "functest", case['dependencies'])) +logger.debug("Functest reporting start") # For all the versions -for version in conf.versions: +for version in versions: # For all the installers - for installer in conf.installers: + for installer in installers: # get scenarios - scenario_results = utils.getScenarios(tempest, installer, version) - scenario_stats = utils.getScenarioStats(scenario_results) + scenario_results = rp_utils.getScenarios(tempest, installer, version) + scenario_stats = rp_utils.getScenarioStats(scenario_results) items = {} scenario_result_criteria = {} - scenario_file_name = (conf.REPORTING_PATH + - "/functest/release/" + version + - "/scenario_history.txt") + scenario_file_name = ("./display/" + version + + "/functest/scenario_history.txt") + # initiate scenario file if it does not exist + if not os.path.isfile(scenario_file_name): + with open(scenario_file_name, "a") as my_file: + logger.debug("Create scenario file: %s" % scenario_file_name) + my_file.write("date,scenario,installer,detail,score\n") # For all the scenarios get results for s, s_result in scenario_results.items(): @@ -102,7 +115,7 @@ for version in conf.versions: if len(s_result) > 0: build_tag = s_result[len(s_result)-1]['build_tag'] logger.debug("Build tag: %s" % build_tag) - s_url = s_url = utils.getJenkinsUrl(build_tag) + s_url = s_url = rp_utils.getJenkinsUrl(build_tag) logger.info("last jenkins url: %s" % s_url) testCases2BeDisplayed = [] # Check if test cas |