summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-03-06 14:44:47 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2017-03-07 08:20:43 +0100
commita2a28ef2f3532ac26de88b746305d26f900b16fc (patch)
tree6b4c1e89b788b7c2f9596a296b674cee6183fea4 /utils/test/reporting
parentd0c327484b58ffbbf9775b8aad6a25999246d3d6 (diff)
bug fix: last 4 run reporting for storperf
- bug fix: copy/paste of yardstick code but list of results is not sorted by default, taking the last 4 array items lead to random results on the 4 last run sort results before taking the last 4 results to establish last 4 run criteria - enhancement: add link to last CI run in the reporting page - fix trend line bug Change-Id: Ice16832a81cb65503a63b16321a2be92a427d279 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'utils/test/reporting')
-rw-r--r--utils/test/reporting/storperf/reporting-status.py37
-rw-r--r--utils/test/reporting/storperf/template/index-status-tmpl.html4
-rw-r--r--utils/test/reporting/utils/scenarioResult.py6
3 files changed, 34 insertions, 13 deletions
diff --git a/utils/test/reporting/storperf/reporting-status.py b/utils/test/reporting/storperf/reporting-status.py
index 674fdd880..888e339f8 100644
--- a/utils/test/reporting/storperf/reporting-status.py
+++ b/utils/test/reporting/storperf/reporting-status.py
@@ -63,15 +63,23 @@ for version in versions:
logger.info("ten_score: %s / %s" % (ten_score, ten_criteria))
- 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:
- if "PASS" in v['criteria']:
- four_score += 1
- logger.info("four_score: %s / %s " % (four_score, four_criteria))
+ try:
+ LASTEST_TESTS = rp_utils.get_config(
+ 'general.nb_iteration_tests_success_criteria')
+ s_result.sort(key=lambda x: x['start_date'])
+ four_result = s_result[-LASTEST_TESTS:]
+ logger.debug("four_result: {}".format(four_result))
+ logger.debug("LASTEST_TESTS: {}".format(LASTEST_TESTS))
+ # logger.debug("four_result: {}".format(four_result))
+ four_criteria = len(four_result)
+ for v in four_result:
+ if "PASS" in v['criteria']:
+ four_score += 1
+ logger.info("4 Score: %s / %s " % (four_score,
+ four_criteria))
+ except:
+ logger.error("Impossible to retrieve the four_score")
try:
s_status = (four_score * 100) / four_criteria
@@ -82,12 +90,20 @@ for version in versions:
s_ten_score = str(ten_score) + '/' + str(ten_criteria)
s_score_percent = str(s_status)
- if '100' == s_status:
+ logger.debug(" s_status: {}".format(s_status))
+ if s_status == 100:
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))
+ s_url = ""
+ 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 = rp_utils.getJenkinsUrl(build_tag)
+ logger.info("last jenkins url: %s" % s_url)
+
# Save daily results in a file
path_validation_file = ("./display/" + version +
"/storperf/scenario_history.txt")
@@ -106,7 +122,8 @@ for version in versions:
scenario_result_criteria[s] = sr.ScenarioResult(s_status,
s_four_score,
s_ten_score,
- s_score_percent)
+ s_score_percent,
+ s_url)
logger.info("--------------------------")
diff --git a/utils/test/reporting/storperf/template/index-status-tmpl.html b/utils/test/reporting/storperf/template/index-status-tmpl.html
index e3a18b1ce..e0fcc6828 100644
--- a/utils/test/reporting/storperf/template/index-status-tmpl.html
+++ b/utils/test/reporting/storperf/template/index-status-tmpl.html
@@ -25,7 +25,7 @@
}
// trend line management
- d3.csv("./scenario_history.csv", function(data) {
+ d3.csv("./scenario_history.txt", function(data) {
// ***************************************
// Create the trend line
{% for scenario in scenario_results.keys() -%}
@@ -95,7 +95,7 @@
</tr>
{% for scenario,result in scenario_results.iteritems() -%}
<tr class="tr-ok">
- <td>{{scenario}}</td>
+ <td><a href="{{scenario_results[scenario].getLastUrl()}}">{{scenario}}</a></td>
<td><div id="gaugeScenario{{loop.index}}"></div></td>
<td><div id="trend_svg{{loop.index}}"></div></td>
<td>{{scenario_results[scenario].getFourDaysScore()}}</td>
diff --git a/utils/test/reporting/utils/scenarioResult.py b/utils/test/reporting/utils/scenarioResult.py
index 1f7eb2b24..6029d7f42 100644
--- a/utils/test/reporting/utils/scenarioResult.py
+++ b/utils/test/reporting/utils/scenarioResult.py
@@ -10,11 +10,12 @@
class ScenarioResult(object):
def __init__(self, status, four_days_score='', ten_days_score='',
- score_percent=0.0):
+ score_percent=0.0, last_url=''):
self.status = status
self.four_days_score = four_days_score
self.ten_days_score = ten_days_score
self.score_percent = score_percent
+ self.last_url = last_url
def getStatus(self):
return self.status
@@ -27,3 +28,6 @@ class ScenarioResult(object):
def getScorePercent(self):
return self.score_percent
+
+ def getLastUrl(self):
+ return self.last_url