diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2016-09-19 00:33:27 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2016-09-19 02:48:27 +0000 |
commit | 19630581f1ac53918aa5cc15faca8b2f0d53c00e (patch) | |
tree | 5a33a41af4dd561a06dc9804570f29dde7c82b75 /utils/test/reporting/yardstick/reporting-status.py | |
parent | c5a5ac59a33dacaaf47b210aee42c75f4459b273 (diff) |
Change display way of reporting status, add last ten days score
JIRA: YARDSTICK-350
Change-Id: Iea1d8a30cf3464c8b9a0b8b6ac2e0ce41adea00d
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'utils/test/reporting/yardstick/reporting-status.py')
-rw-r--r-- | utils/test/reporting/yardstick/reporting-status.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/utils/test/reporting/yardstick/reporting-status.py b/utils/test/reporting/yardstick/reporting-status.py index 57a95947b..345acef42 100644 --- a/utils/test/reporting/yardstick/reporting-status.py +++ b/utils/test/reporting/yardstick/reporting-status.py @@ -26,6 +26,7 @@ logger.info("* Data retention = %s days *" % conf.PERIOD) logger.info("* *") logger.info("*******************************************") + # For all the versions for version in conf.versions: # For all the installers @@ -38,8 +39,6 @@ for version in conf.versions: if not scenario_results.has_key(k): scenario_results[k] = [] scenario_results[k] += stable_result[k] - for k,v in scenario_results.items(): - scenario_results[k] = v[0:conf.LASTEST_TESTS] scenario_result_criteria = {} # From each scenarios get results list @@ -47,23 +46,26 @@ for version in conf.versions: logger.info("---------------------------------") logger.info("installer %s, version %s, scenario %s:" % (installer, version, s)) - s_status = 'KO' - scenario_criteria = len(s_result) - scenario_score = 0 - + ten_criteria = len(s_result) + ten_score = 0 for v in s_result: - if v['criteria'] == 'SUCCESS': - scenario_score += 1 + ten_score += v - if scenario_score == scenario_criteria and scenario_criteria == 4: - s_status = 'OK' - logger.info(">>>>> scenario OK, save the information") - else: - logger.info(">>>> scenario not OK, score = %s/%s" % (scenario_score, scenario_criteria)) + four_result = s_result[:conf.LASTEST_TESTS] + four_criteria = len(four_result) + four_score = 0 + for v in four_result: + four_score += v - s_score = str(scenario_score) + '/' + str(scenario_criteria) - scenario_result_criteria[s] = sr.ScenarioResult(s_status, s_score) + s_status = str(utils.get_status(four_result, s_result)) + s_four_score = str(four_score) + '/' + str(four_criteria) + s_ten_score = str(ten_score) + '/' + str(ten_criteria) + scenario_result_criteria[s] = sr.ScenarioResult(s_status, s_four_score, s_ten_score) + if '100' == s_status: + logger.info(">>>>> scenario OK, save the information") + else: + logger.info(">>>> scenario not OK, last 4 iterations = %s, last 10 days = %s" % (s_four_score, s_ten_score)) logger.info("--------------------------") templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) |