summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/test/dashboard/dashboard/conf/config.py4
-rw-r--r--utils/test/dashboard/dashboard/elastic2kibana/main.py20
-rw-r--r--utils/test/dashboard/etc/config.ini1
-rw-r--r--utils/test/reporting/css/default.css84
-rwxr-xr-xutils/test/reporting/functest/reporting-status.py44
-rw-r--r--utils/test/reporting/functest/template/index-status-tmpl.html3
6 files changed, 132 insertions, 24 deletions
diff --git a/utils/test/dashboard/dashboard/conf/config.py b/utils/test/dashboard/dashboard/conf/config.py
index 143b1939a..48fed8894 100644
--- a/utils/test/dashboard/dashboard/conf/config.py
+++ b/utils/test/dashboard/dashboard/conf/config.py
@@ -26,7 +26,6 @@ class APIConfig:
self.es_url = 'http://localhost:9200'
self.es_creds = None
self.kibana_url = None
- self.is_js = True
self.js_path = None
def _get_str_parameter(self, section, param):
@@ -67,7 +66,6 @@ class APIConfig:
obj.es_url = obj._get_str_parameter("elastic", "url")
obj.es_creds = obj._get_str_parameter("elastic", "creds")
obj.kibana_url = obj._get_str_parameter("kibana", "url")
- obj.is_js = obj._get_bool_parameter("kibana", "js")
obj.js_path = obj._get_str_parameter("kibana", "js_path")
return obj
@@ -76,9 +74,7 @@ class APIConfig:
return "elastic_url = %s \n" \
"elastic_creds = %s \n" \
"kibana_url = %s \n" \
- "is_js = %s \n" \
"js_path = %s \n" % (self.es_url,
self.es_creds,
self.kibana_url,
- self.is_js,
self.js_path)
diff --git a/utils/test/dashboard/dashboard/elastic2kibana/main.py b/utils/test/dashboard/dashboard/elastic2kibana/main.py
index 35a154307..9ee894279 100644
--- a/utils/test/dashboard/dashboard/elastic2kibana/main.py
+++ b/utils/test/dashboard/dashboard/elastic2kibana/main.py
@@ -64,13 +64,12 @@ class KibanaConstructor(object):
visualizations,
CONF.es_url,
CONF.es_creds)
- if CONF.is_js:
- self._set_js_dict(case,
- pod,
- installer,
- family,
- vis_p.get('name'),
- dashboard.id)
+ self._set_js_dict(case,
+ pod,
+ installer,
+ family,
+ vis_p.get('name'),
+ dashboard.id)
@staticmethod
def _construct_visualizations(project,
@@ -112,10 +111,9 @@ class KibanaConstructor(object):
js_installer[pod] = CONF.kibana_url + '#/dashboard/' + id
def config_js(self):
- if CONF.is_js:
- with open(CONF.js_path, 'w+') as conf_js_fdesc:
- conf_js_fdesc.write('var kibana_dashboard_links = ')
- conf_js_fdesc.write(str(self.js_dict).replace("u'", "'"))
+ with open(CONF.js_path, 'w+') as conf_js_fdesc:
+ conf_js_fdesc.write('var kibana_dashboard_links = ')
+ conf_js_fdesc.write(str(self.js_dict).replace("u'", "'"))
def _get_pods_and_scenarios(self, project, case, installer):
query = json.JSONEncoder().encode({
diff --git a/utils/test/dashboard/etc/config.ini b/utils/test/dashboard/etc/config.ini
index 1e67bd822..d9327981e 100644
--- a/utils/test/dashboard/etc/config.ini
+++ b/utils/test/dashboard/etc/config.ini
@@ -6,5 +6,4 @@ creds =
[kibana]
url = http://10.63.243.17:5601/app/kibana
-js = true
js_path = /usr/share/nginx/html/kibana_dashboards/conf.js
diff --git a/utils/test/reporting/css/default.css b/utils/test/reporting/css/default.css
index a9fa69db7..e32fa5fba 100644
--- a/utils/test/reporting/css/default.css
+++ b/utils/test/reporting/css/default.css
@@ -108,3 +108,87 @@ h2 {
stroke: steelblue;
stroke-width: 1.5px;
}
+
+.myButtonPdf {
+ -moz-box-shadow:inset 0px 1px 0px 0px #f29c93;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #f29c93;
+ box-shadow:inset 0px 1px 0px 0px #f29c93;
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100));
+ background:-moz-linear-gradient(top, #fe1a00 5%, #ce0100 100%);
+ background:-webkit-linear-gradient(top, #fe1a00 5%, #ce0100 100%);
+ background:-o-linear-gradient(top, #fe1a00 5%, #ce0100 100%);
+ background:-ms-linear-gradient(top, #fe1a00 5%, #ce0100 100%);
+ background:linear-gradient(to bottom, #fe1a00 5%, #ce0100 100%);
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100',GradientType=0);
+ background-color:#fe1a00;
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+ border-radius:6px;
+ border:1px solid #d83526;
+ display:inline-block;
+ cursor:pointer;
+ color:#ffffff;
+ font-family:Arial;
+ font-size:15px;
+ font-weight:bold;
+ padding:6px 24px;
+ text-decoration:none;
+ text-shadow:0px 1px 0px #b23e35;
+}
+.myButtonPdf:hover {
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00));
+ background:-moz-linear-gradient(top, #ce0100 5%, #fe1a00 100%);
+ background:-webkit-linear-gradient(top, #ce0100 5%, #fe1a00 100%);
+ background:-o-linear-gradient(top, #ce0100 5%, #fe1a00 100%);
+ background:-ms-linear-gradient(top, #ce0100 5%, #fe1a00 100%);
+ background:linear-gradient(to bottom, #ce0100 5%, #fe1a00 100%);
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00',GradientType=0);
+ background-color:#ce0100;
+}
+.myButtonPdf:active {
+ position:relative;
+ top:1px;
+}
+
+
+.myButtonCSV {
+ -moz-box-shadow:inset 0px 1px 0px 0px #bbdaf7;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #bbdaf7;
+ box-shadow:inset 0px 1px 0px 0px #bbdaf7;
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5));
+ background:-moz-linear-gradient(top, #79bbff 5%, #378de5 100%);
+ background:-webkit-linear-gradient(top, #79bbff 5%, #378de5 100%);
+ background:-o-linear-gradient(top, #79bbff 5%, #378de5 100%);
+ background:-ms-linear-gradient(top, #79bbff 5%, #378de5 100%);
+ background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%);
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5',GradientType=0);
+ background-color:#79bbff;
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+ border-radius:6px;
+ border:1px solid #84bbf3;
+ display:inline-block;
+ cursor:pointer;
+ color:#ffffff;
+ font-family:Arial;
+ font-size:15px;
+ font-weight:bold;
+ padding:6px 24px;
+ text-decoration:none;
+ text-shadow:0px 1px 0px #528ecc;
+}
+.myButtonCSV:hover {
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff));
+ background:-moz-linear-gradient(top, #378de5 5%, #79bbff 100%);
+ background:-webkit-linear-gradient(top, #378de5 5%, #79bbff 100%);
+ background:-o-linear-gradient(top, #378de5 5%, #79bbff 100%);
+ background:-ms-linear-gradient(top, #378de5 5%, #79bbff 100%);
+ background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%);
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff',GradientType=0);
+ background-color:#378de5;
+}
+.myButtonCSV:active {
+ position:relative;
+ top:1px;
+}
+
diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py
index 9df699629..b527b7861 100755
--- a/utils/test/reporting/functest/reporting-status.py
+++ b/utils/test/reporting/functest/reporting-status.py
@@ -8,6 +8,7 @@
#
import datetime
import jinja2
+import pdfkit
import requests
import sys
import time
@@ -186,8 +187,7 @@ for version in conf.versions:
s_score = str(scenario_score) + "/" + str(scenario_criteria)
s_score_percent = 0.0
try:
- s_score_percent = float(
- scenario_score) / float(scenario_criteria) * 100
+ s_score_percent = float(scenario_score) / float(scenario_criteria) * 100
except:
logger.error("cannot calculate the score percent")
@@ -200,7 +200,7 @@ for version in conf.versions:
logger.info(">>>>> scenario OK, save the information")
s_status = "OK"
path_validation_file = (conf.REPORTING_PATH +
- "/release/" + version +
+ "/functest/release/" + version +
"/validated_scenario_history.txt")
with open(path_validation_file, "a") as f:
time_format = "%Y-%m-%d %H:%M"
@@ -210,7 +210,7 @@ for version in conf.versions:
# Save daily results in a file
path_validation_file = (conf.REPORTING_PATH +
- "/release/" + version +
+ "/functest/release/" + version +
"/scenario_history.txt")
with open(path_validation_file, "a") as f:
info = (reportingDate + "," + s + "," + installer +
@@ -228,7 +228,7 @@ for version in conf.versions:
templateEnv = jinja2.Environment(
loader=templateLoader, autoescape=True)
- TEMPLATE_FILE = "/template/index-status-tmpl.html"
+ TEMPLATE_FILE = "/functest/template/index-status-tmpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(scenario_stats=scenario_stats,
@@ -239,6 +239,34 @@ for version in conf.versions:
version=version,
date=reportingDate)
- with open(conf.REPORTING_PATH + "/release/" + version +
- "/index-status-" + installer + ".html", "wb") as fh:
- fh.write(outputText)
+ with open(conf.REPORTING_PATH + "/functest/release/" + version +
+ "/index-status-" + installer + ".html", "wb") as fh:
+ fh.write(outputText)
+
+ # Generate outputs for export
+ # pdf
+ try:
+ pdf_path = ("http://testresults.opnfv.org/reporting/" +
+ "functest/release/" + version +
+ "/index-status-" + installer + ".html")
+ pdf_doc_name = (conf.REPORTING_PATH +
+ "/functest/release/" + version +
+ "/status-" + installer + ".pdf")
+ pdfkit.from_url(pdf_path, pdf_doc_name)
+ except IOError:
+ logger.info("pdf generated anyway...")
+ except:
+ logger.error("impossible to generate PDF")
+ # csv
+ # generate sub files based on scenario_history.txt
+ scenario_installer_file_name = (conf.REPORTING_PATH +
+ "/functest/release/" + version +
+ "/scenario_history_" +
+ installer + ".txt")
+ scenario_installer_file = open(scenario_installer_file_name, "w")
+
+ with open(path_validation_file, "r") as f:
+ for line in f:
+ if installer in line:
+ scenario_installer_file.write(line)
+ scenario_installer_file.close
diff --git a/utils/test/reporting/functest/template/index-status-tmpl.html b/utils/test/reporting/functest/template/index-status-tmpl.html
index 2beb9128e..e3c9c5fc0 100644
--- a/utils/test/reporting/functest/template/index-status-tmpl.html
+++ b/utils/test/reporting/functest/template/index-status-tmpl.html
@@ -148,6 +148,9 @@ $(document).ready(function (){
</div>
{%- endfor %}
see <a href="https://wiki.opnfv.org/pages/viewpage.action?pageId=6828617">Functest scoring wiki page</a> for details on scenario scoring
+ <div> <br>
+ <a href="./status-{{installer}}.pdf" class="myButtonPdf">Export to PDF</a> <a href="./scenario_history_{{installer}}.txt" class="myButtonCSV">Export to CSV</a>
+ </div>
</div>
<div class="col-md-1"></div>
</div>