X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Ftest%2Freporting%2Freporting%2Fqtip%2Freporting-status.py;h=524338ca0ebe49b495c54f5bc25e28c35ecf167d;hb=02ea0678f840da4f63821c2753079263c6fcde11;hp=f0127b50f7672a077b7cb13a5b6388e8703d29da;hpb=75ad867556d9475c7881863dfb44ccdcc154228b;p=releng.git diff --git a/utils/test/reporting/reporting/qtip/reporting-status.py b/utils/test/reporting/reporting/qtip/reporting-status.py index f0127b50f..524338ca0 100644 --- a/utils/test/reporting/reporting/qtip/reporting-status.py +++ b/utils/test/reporting/reporting/qtip/reporting-status.py @@ -33,8 +33,7 @@ def prepare_profile_file(version): if not os.path.exists(profile_dir): os.makedirs(profile_dir) - profile_file = "{}/{}/scenario_history.txt".format(profile_dir, - version) + profile_file = "{}/scenario_history.txt".format(profile_dir) if not os.path.exists(profile_file): with open(profile_file, 'w') as f: info = 'date,scenario,installer,details,score\n' @@ -46,27 +45,22 @@ def prepare_profile_file(version): def profile_results(results, installer, profile_fd): result_criterias = {} for s_p, s_p_result in results.iteritems(): - ten_criteria = len(s_p_result) - ten_score = sum(s_p_result) + avg_last_ten = sum([int(s) for s in s_p_result]) / len(s_p_result) LASTEST_TESTS = rp_utils.get_config( 'general.nb_iteration_tests_success_criteria') - four_result = s_p_result[:LASTEST_TESTS] - four_criteria = len(four_result) - four_score = sum(four_result) - - s_four_score = str(four_score / four_criteria) - s_ten_score = str(ten_score / ten_criteria) + last_four = s_p_result[-LASTEST_TESTS:] + avg_last_four = sum([int(s) for s in last_four]) / len(last_four) info = '{},{},{},{},{}\n'.format(reportingDate, s_p, installer, - s_ten_score, - s_four_score) + '', + avg_last_four) profile_fd.write(info) result_criterias[s_p] = sr.ScenarioResult('OK', - s_four_score, - s_ten_score, + avg_last_four, + avg_last_ten, '100') logger.info("--------------------------")