summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/yardstick/reporting-status.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/reporting/yardstick/reporting-status.py')
-rw-r--r--utils/test/reporting/yardstick/reporting-status.py52
1 files changed, 29 insertions, 23 deletions
diff --git a/utils/test/reporting/yardstick/reporting-status.py b/utils/test/reporting/yardstick/reporting-status.py
index 49809e9d8..338154987 100644
--- a/utils/test/reporting/yardstick/reporting-status.py
+++ b/utils/test/reporting/yardstick/reporting-status.py
@@ -10,31 +10,36 @@ import datetime
import jinja2
import os
-import reportingUtils as utils
-import reportingConf as conf
import scenarioResult as sr
from scenarios import config as cf
+# manage conf
+import utils.reporting_utils as rp_utils
+
+installers = rp_utils.get_config('general.installers')
+versions = rp_utils.get_config('general.versions')
+PERIOD = rp_utils.get_config('general.period')
+
# Logger
-logger = utils.getLogger("Yardstick-Status")
+logger = rp_utils.getLogger("Yardstick-Status")
reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
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("* *")
logger.info("*******************************************")
# 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 results data
- scenario_results = utils.getScenarioStatus(installer, version)
+ scenario_results = rp_utils.getScenarioStatus(installer, version)
if 'colorado' == version:
- stable_result = utils.getScenarioStatus(installer,
- 'stable/colorado')
+ stable_result = rp_utils.getScenarioStatus(installer,
+ 'stable/colorado')
for k, v in stable_result.items():
if k not in scenario_results.keys():
scenario_results[k] = []
@@ -48,24 +53,25 @@ for version in conf.versions:
# From each scenarios get results list
for s, s_result in scenario_results.items():
logger.info("---------------------------------")
- logger.info("installer %s, version %s, scenario %s:" % (installer,
- version, s))
+ logger.info("installer %s, version %s, " +
+ "scenario %s:" % (installer, version, s))
ten_criteria = len(s_result)
ten_score = 0
for v in s_result:
ten_score += v
- four_result = s_result[:conf.LASTEST_TESTS]
+ LASTEST_TESTS = rp_utils.get_config('general.nb_iteration_tests_success_criteria')
+ four_result = s_result[:LASTEST_TESTS]
four_criteria = len(four_result)
four_score = 0
for v in four_result:
four_score += v
- s_status = str(utils.get_percent(four_result, s_result))
+ s_status = str(rp_utils.get_percent(four_result, s_result))
s_four_score = str(four_score) + '/' + str(four_criteria)
s_ten_score = str(ten_score) + '/' + str(ten_criteria)
- s_score_percent = utils.get_percent(four_result, s_result)
+ s_score_percent = rp_utils.get_percent(four_result, s_result)
if '100' == s_status:
logger.info(">>>>> scenario OK, save the information")
@@ -74,9 +80,8 @@ for version in conf.versions:
last 10 days = %s" % (s_four_score, s_ten_score))
# Save daily results in a file
- path_validation_file = (conf.REPORTING_PATH +
- "/release/" + version +
- "/scenario_history.txt")
+ path_validation_file = ("./display/" + version +
+ "/yardstick/scenario_history.txt")
if not os.path.exists(path_validation_file):
with open(path_validation_file, 'w') as f:
@@ -96,18 +101,19 @@ for version in conf.versions:
logger.info("--------------------------")
- templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH)
- templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True)
+ templateLoader = jinja2.FileSystemLoader(".")
+ templateEnv = jinja2.Environment(loader=templateLoader,
+ autoescape=True)
- TEMPLATE_FILE = "/template/index-status-tmpl.html"
+ TEMPLATE_FILE = "./yardstick/template/index-status-tmpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(scenario_results=scenario_result_criteria,
installer=installer,
- period=conf.PERIOD,
+ period=PERIOD,
version=version,
date=reportingDate)
- with open(conf.REPORTING_PATH + "/release/" + version +
- "/index-status-" + installer + ".html", "wb") as fh:
+ with open("./display/" + version +
+ "/yardstick/status-" + installer + ".html", "wb") as fh:
fh.write(outputText)