From 909974639506803e066833ac826a0d93c74cad82 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 14 Sep 2016 16:16:46 +0200 Subject: Add gauge metrics for Functest reporting dashboard JIRA: FUNCTEST-476 Change-Id: Ia39ffa8b39a1085a081d6128871cee20436e051c Signed-off-by: jose.lausuch --- utils/test/reporting/functest/img/gauge_0.png | Bin 0 -> 3644 bytes utils/test/reporting/functest/img/gauge_100.png | Bin 0 -> 3191 bytes utils/test/reporting/functest/img/gauge_16.7.png | Bin 0 -> 3170 bytes utils/test/reporting/functest/img/gauge_25.png | Bin 0 -> 3108 bytes utils/test/reporting/functest/img/gauge_33.3.png | Bin 0 -> 3081 bytes utils/test/reporting/functest/img/gauge_41.7.png | Bin 0 -> 3169 bytes utils/test/reporting/functest/img/gauge_50.png | Bin 0 -> 3123 bytes utils/test/reporting/functest/img/gauge_58.3.png | Bin 0 -> 3161 bytes utils/test/reporting/functest/img/gauge_66.7.png | Bin 0 -> 3069 bytes utils/test/reporting/functest/img/gauge_75.png | Bin 0 -> 3030 bytes utils/test/reporting/functest/img/gauge_8.3.png | Bin 0 -> 2993 bytes utils/test/reporting/functest/img/gauge_83.3.png | Bin 0 -> 3122 bytes utils/test/reporting/functest/img/gauge_91.7.png | Bin 0 -> 3008 bytes utils/test/reporting/functest/reporting-status.py | 8 +++-- utils/test/reporting/functest/scenarioResult.py | 7 +++- .../functest/template/index-status-tmpl.html | 38 ++++++++++++++++----- 16 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 utils/test/reporting/functest/img/gauge_0.png create mode 100644 utils/test/reporting/functest/img/gauge_100.png create mode 100644 utils/test/reporting/functest/img/gauge_16.7.png create mode 100644 utils/test/reporting/functest/img/gauge_25.png create mode 100644 utils/test/reporting/functest/img/gauge_33.3.png create mode 100644 utils/test/reporting/functest/img/gauge_41.7.png create mode 100644 utils/test/reporting/functest/img/gauge_50.png create mode 100644 utils/test/reporting/functest/img/gauge_58.3.png create mode 100644 utils/test/reporting/functest/img/gauge_66.7.png create mode 100644 utils/test/reporting/functest/img/gauge_75.png create mode 100644 utils/test/reporting/functest/img/gauge_8.3.png create mode 100644 utils/test/reporting/functest/img/gauge_83.3.png create mode 100644 utils/test/reporting/functest/img/gauge_91.7.png (limited to 'utils') diff --git a/utils/test/reporting/functest/img/gauge_0.png b/utils/test/reporting/functest/img/gauge_0.png new file mode 100644 index 000000000..ecefc0e66 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_0.png differ diff --git a/utils/test/reporting/functest/img/gauge_100.png b/utils/test/reporting/functest/img/gauge_100.png new file mode 100644 index 000000000..e199e1561 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_100.png differ diff --git a/utils/test/reporting/functest/img/gauge_16.7.png b/utils/test/reporting/functest/img/gauge_16.7.png new file mode 100644 index 000000000..3e3993c3b Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_16.7.png differ diff --git a/utils/test/reporting/functest/img/gauge_25.png b/utils/test/reporting/functest/img/gauge_25.png new file mode 100644 index 000000000..4923659b9 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_25.png differ diff --git a/utils/test/reporting/functest/img/gauge_33.3.png b/utils/test/reporting/functest/img/gauge_33.3.png new file mode 100644 index 000000000..364574b4a Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_33.3.png differ diff --git a/utils/test/reporting/functest/img/gauge_41.7.png b/utils/test/reporting/functest/img/gauge_41.7.png new file mode 100644 index 000000000..8c3e910fa Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_41.7.png differ diff --git a/utils/test/reporting/functest/img/gauge_50.png b/utils/test/reporting/functest/img/gauge_50.png new file mode 100644 index 000000000..2874b9fcf Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_50.png differ diff --git a/utils/test/reporting/functest/img/gauge_58.3.png b/utils/test/reporting/functest/img/gauge_58.3.png new file mode 100644 index 000000000..beedc8aa9 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_58.3.png differ diff --git a/utils/test/reporting/functest/img/gauge_66.7.png b/utils/test/reporting/functest/img/gauge_66.7.png new file mode 100644 index 000000000..93f44d133 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_66.7.png differ diff --git a/utils/test/reporting/functest/img/gauge_75.png b/utils/test/reporting/functest/img/gauge_75.png new file mode 100644 index 000000000..9fc261ff8 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_75.png differ diff --git a/utils/test/reporting/functest/img/gauge_8.3.png b/utils/test/reporting/functest/img/gauge_8.3.png new file mode 100644 index 000000000..59f86571e Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_8.3.png differ diff --git a/utils/test/reporting/functest/img/gauge_83.3.png b/utils/test/reporting/functest/img/gauge_83.3.png new file mode 100644 index 000000000..27ae4ec54 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_83.3.png differ diff --git a/utils/test/reporting/functest/img/gauge_91.7.png b/utils/test/reporting/functest/img/gauge_91.7.png new file mode 100644 index 000000000..280865714 Binary files /dev/null and b/utils/test/reporting/functest/img/gauge_91.7.png differ diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py index 0b80fe49a..ef567f17d 100755 --- a/utils/test/reporting/functest/reporting-status.py +++ b/utils/test/reporting/functest/reporting-status.py @@ -175,6 +175,8 @@ for version in conf.versions: scenario_criteria = conf.MAX_SCENARIO_CRITERIA s_score = str(scenario_score) + "/" + str(scenario_criteria) + s_score_percent = float( + scenario_score) / float(scenario_criteria) * 100 s_status = "KO" if scenario_score < scenario_criteria: logger.info(">>>> scenario not OK, score = %s/%s" % @@ -191,11 +193,13 @@ for version in conf.versions: ";" + installer + ";" + s + "\n") f.write(info) - scenario_result_criteria[s] = sr.ScenarioResult(s_status, s_score) + scenario_result_criteria[s] = sr.ScenarioResult(s_status, s_score, + s_score_percent) logger.info("--------------------------") templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) + templateEnv = jinja2.Environment( + loader=templateLoader, autoescape=True) TEMPLATE_FILE = "/template/index-status-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) diff --git a/utils/test/reporting/functest/scenarioResult.py b/utils/test/reporting/functest/scenarioResult.py index 743346adc..c6c337330 100644 --- a/utils/test/reporting/functest/scenarioResult.py +++ b/utils/test/reporting/functest/scenarioResult.py @@ -9,12 +9,17 @@ class ScenarioResult(object): - def __init__(self, status, score=0): + + def __init__(self, status, score=0, score_percent=0): self.status = status self.score = score + self.score_percent = score_percent def getStatus(self): return self.status def getScore(self): return self.score + + def getScorePercent(self): + return self.score_percent \ No newline at end of file diff --git a/utils/test/reporting/functest/template/index-status-tmpl.html b/utils/test/reporting/functest/template/index-status-tmpl.html index da2213bc0..96240de5b 100644 --- a/utils/test/reporting/functest/template/index-status-tmpl.html +++ b/utils/test/reporting/functest/template/index-status-tmpl.html @@ -48,11 +48,33 @@ {% for scenario,iteration in scenario_stats.iteritems() -%} {{scenario}} - {%if scenario_results[scenario].getStatus() is sameas "OK" -%} - - {%- else -%} - - {%- endif %} + {%if scenario_results[scenario].getScorePercent() < 8.3 -%} + + {%elif scenario_results[scenario].getScorePercent() < 16.7 -%} + + {%elif scenario_results[scenario].getScorePercent() < 25 -%} + + {%elif scenario_results[scenario].getScorePercent() < 33.3 -%} + + {%elif scenario_results[scenario].getScorePercent() < 41.7 -%} + + {%elif scenario_results[scenario].getScorePercent() < 50 -%} + + {%elif scenario_results[scenario].getScorePercent() < 58.3 -%} + + {%elif scenario_results[scenario].getScorePercent() < 66.7 -%} + + {%elif scenario_results[scenario].getScorePercent() < 75 -%} + + {%elif scenario_results[scenario].getScorePercent() < 83.3 -%} + + {%elif scenario_results[scenario].getScorePercent() < 91.7 -%} + + {%elif scenario_results[scenario].getScorePercent() < 100 -%} + + {%- else -%} + + {%- endif %} {{scenario_results[scenario].getScore()}} {{iteration}} @@ -78,14 +100,14 @@ {% if test.getCriteria() > -1 -%} {{test.getDisplayName() }} {%- endif %} - {% if test.getTier() > 3 -%} + {% if test.getTier() > 3 -%} * {%- endif %} - + {%- endfor %} - {% for test in items[scenario] -%} + {% for test in items[scenario] -%} {% if test.getCriteria() > 2 -%} {%- elif test.getCriteria() > 1 -%} -- cgit 1.2.3-korg