From b24f036bc4817ec3f8ee29593c93721f826a6264 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Thu, 29 Sep 2016 15:39:42 +0200 Subject: Add a trend line to Functest reporting And use d3js lib rather than static images JIRA: FUNCTEST-483 Change-Id: I3c372a8e18fc366dfe510ab551596640fb6d9242 Signed-off-by: Morgan Richomme --- utils/test/reporting/functest/default.css | 77 ----------------- utils/test/reporting/functest/reporting-status.py | 7 +- utils/test/reporting/functest/reportingConf.py | 1 - .../functest/template/index-status-tmpl.html | 96 ++++++++++++++-------- 4 files changed, 66 insertions(+), 115 deletions(-) delete mode 100644 utils/test/reporting/functest/default.css (limited to 'utils/test/reporting/functest') diff --git a/utils/test/reporting/functest/default.css b/utils/test/reporting/functest/default.css deleted file mode 100644 index 897c3b12b..000000000 --- a/utils/test/reporting/functest/default.css +++ /dev/null @@ -1,77 +0,0 @@ -.panel-header-item { - position: relative; - display: inline-block; - padding-left: 17px; - padding-right: 17px; -} - -.panel-pod-name { - margin-top: 10px; - margin-right: 27px; - float:right; - padding: 6px; -} - -.panel-default > .panel-heading .badge { - background-color: #007e88; - position: relative; - display: inline-block; -} - -.panel-default > .panel-heading .progress-bar { - height: 100%; - position: absolute; - left: 0; - top: 0; - width: 100%; - background-color: #0095a2 -} -.panel-default > .panel-heading h4 { - color: white; -} - -.panel-default > .panel-heading { - background-color: #00ADBB; - overflow: hidden; - position: relative; - width: 100%; -} - -th{ - text-align: center; -} - -td{ - text-align: center; -} - -.tr-danger { - background-color: #177870; - color: white; -} - -.btn-more { - color: white; - background-color: #0095a2; -} - -h1 { - display: block; - font-size: 2em; - margin-top: 0.67em; - margin-bottom: 0.67em; - margin-left: 0; - margin-right: 0; - font-weight: bold; -} - -h2 { - display: block; - font-size: 1.5em; - margin-top: 0.83em; - margin-bottom: 0.83em; - margin-left: 0; - margin-right: 0; - font-weight: bold; - color:rgb(128, 128, 128) -} diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py index 90699bd61..9df699629 100755 --- a/utils/test/reporting/functest/reporting-status.py +++ b/utils/test/reporting/functest/reporting-status.py @@ -184,8 +184,13 @@ for version in conf.versions: scenario_criteria = conf.MAX_SCENARIO_CRITERIA s_score = str(scenario_score) + "/" + str(scenario_criteria) - s_score_percent = float( + s_score_percent = 0.0 + try: + s_score_percent = float( scenario_score) / float(scenario_criteria) * 100 + except: + logger.error("cannot calculate the score percent") + s_status = "KO" if scenario_score < scenario_criteria: logger.info(">>>> scenario not OK, score = %s/%s" % diff --git a/utils/test/reporting/functest/reportingConf.py b/utils/test/reporting/functest/reportingConf.py index e1c4b61a8..1c9a2ac9f 100644 --- a/utils/test/reporting/functest/reportingConf.py +++ b/utils/test/reporting/functest/reportingConf.py @@ -13,7 +13,6 @@ installers = ["apex", "compass", "fuel", "joid"] # list of test cases declared in testcases.yaml but that must not be # taken into account for the scoring blacklist = ["ovno", "security_scan"] -# versions = ["brahmaputra", "master"] versions = ["master", "colorado"] PERIOD = 10 MAX_SCENARIO_CRITERIA = 50 diff --git a/utils/test/reporting/functest/template/index-status-tmpl.html b/utils/test/reporting/functest/template/index-status-tmpl.html index 67c23491a..2beb9128e 100644 --- a/utils/test/reporting/functest/template/index-status-tmpl.html +++ b/utils/test/reporting/functest/template/index-status-tmpl.html @@ -3,17 +3,65 @@ - + - + + + + // Draw the trend line + var mytrend = trend("#trend_svg{{loop.index}}",trend{{loop.index}}) + // **************************************** + {%- endfor %} + }); + if ( !window.isLoaded ) { + window.addEventListener("load", function() { + onDocumentReady(); + }, false); + } else { + onDocumentReady(); + } + + +
@@ -40,41 +88,17 @@

List of last scenarios ({{version}}) run over the last {{period}} days

- + + {% for scenario,iteration in scenario_stats.iteritems() -%} - + + -- cgit 1.2.3-korg
ScenarioScenario StatusTrend Score Iteration
{{scenario}}{%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}}