Merge "Refactor reporting dir"
authorMorgan Richomme <morgan.richomme@orange.com>
Thu, 17 Nov 2016 15:33:59 +0000 (15:33 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 17 Nov 2016 15:33:59 +0000 (15:33 +0000)
112 files changed:
utils/test/reporting/3rd_party/css/font-awesome.min.css [moved from utils/test/reporting/assets/css/font-awesome.min.css with 100% similarity]
utils/test/reporting/3rd_party/css/ie8.css [moved from utils/test/reporting/assets/css/ie8.css with 100% similarity]
utils/test/reporting/3rd_party/css/ie9.css [moved from utils/test/reporting/assets/css/ie9.css with 100% similarity]
utils/test/reporting/3rd_party/css/main.css [moved from utils/test/reporting/assets/css/main.css with 100% similarity]
utils/test/reporting/3rd_party/fonts/FontAwesome.otf [moved from utils/test/reporting/assets/fonts/FontAwesome.otf with 100% similarity]
utils/test/reporting/3rd_party/fonts/fontawesome-webfont.eot [moved from utils/test/reporting/assets/fonts/fontawesome-webfont.eot with 100% similarity]
utils/test/reporting/3rd_party/fonts/fontawesome-webfont.svg [moved from utils/test/reporting/assets/fonts/fontawesome-webfont.svg with 100% similarity]
utils/test/reporting/3rd_party/fonts/fontawesome-webfont.ttf [moved from utils/test/reporting/assets/fonts/fontawesome-webfont.ttf with 100% similarity]
utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff [moved from utils/test/reporting/assets/fonts/fontawesome-webfont.woff with 100% similarity]
utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff2 [moved from utils/test/reporting/assets/fonts/fontawesome-webfont.woff2 with 100% similarity]
utils/test/reporting/3rd_party/js/ie/html5shiv.js [moved from utils/test/reporting/assets/js/ie/html5shiv.js with 100% similarity]
utils/test/reporting/3rd_party/js/ie/respond.min.js [moved from utils/test/reporting/assets/js/ie/respond.min.js with 100% similarity]
utils/test/reporting/3rd_party/js/jquery.min.js [moved from utils/test/reporting/assets/js/jquery.min.js with 100% similarity]
utils/test/reporting/3rd_party/js/main.js [moved from utils/test/reporting/assets/js/main.js with 100% similarity]
utils/test/reporting/3rd_party/js/skel.min.js [moved from utils/test/reporting/assets/js/skel.min.js with 100% similarity]
utils/test/reporting/3rd_party/js/util.js [moved from utils/test/reporting/assets/js/util.js with 100% similarity]
utils/test/reporting/3rd_party/sass/base/_page.scss [moved from utils/test/reporting/assets/sass/base/_page.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/base/_typography.scss [moved from utils/test/reporting/assets/sass/base/_typography.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_box.scss [moved from utils/test/reporting/assets/sass/components/_box.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_button.scss [moved from utils/test/reporting/assets/sass/components/_button.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_form.scss [moved from utils/test/reporting/assets/sass/components/_form.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_icon.scss [moved from utils/test/reporting/assets/sass/components/_icon.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_image.scss [moved from utils/test/reporting/assets/sass/components/_image.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_list.scss [moved from utils/test/reporting/assets/sass/components/_list.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_section.scss [moved from utils/test/reporting/assets/sass/components/_section.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_table.scss [moved from utils/test/reporting/assets/sass/components/_table.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/components/_tiles.scss [moved from utils/test/reporting/assets/sass/components/_tiles.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/ie8.scss [moved from utils/test/reporting/assets/sass/ie8.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/ie9.scss [moved from utils/test/reporting/assets/sass/ie9.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/layout/_footer.scss [moved from utils/test/reporting/assets/sass/layout/_footer.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/layout/_header.scss [moved from utils/test/reporting/assets/sass/layout/_header.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/layout/_main.scss [moved from utils/test/reporting/assets/sass/layout/_main.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/layout/_menu.scss [moved from utils/test/reporting/assets/sass/layout/_menu.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/layout/_wrapper.scss [moved from utils/test/reporting/assets/sass/layout/_wrapper.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/libs/_functions.scss [moved from utils/test/reporting/assets/sass/libs/_functions.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/libs/_mixins.scss [moved from utils/test/reporting/assets/sass/libs/_mixins.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/libs/_skel.scss [moved from utils/test/reporting/assets/sass/libs/_skel.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/libs/_vars.scss [moved from utils/test/reporting/assets/sass/libs/_vars.scss with 100% similarity]
utils/test/reporting/3rd_party/sass/main.scss [moved from utils/test/reporting/assets/sass/main.scss with 100% similarity]
utils/test/reporting/docker/Dockerfile [new file with mode: 0644]
utils/test/reporting/docker/reporting.sh [new file with mode: 0755]
utils/test/reporting/docker/requirements.pip [new file with mode: 0644]
utils/test/reporting/functest/reporting-status.py
utils/test/reporting/functest/reporting-tempest.py
utils/test/reporting/functest/reporting-vims.py
utils/test/reporting/functest/reportingConf.py [deleted file]
utils/test/reporting/functest/reportingUtils.py [deleted file]
utils/test/reporting/functest/template/index-status-tmpl.html
utils/test/reporting/functest/template/index-tempest-tmpl.html
utils/test/reporting/functest/template/index-vims-tmpl.html
utils/test/reporting/functest/testCase.py
utils/test/reporting/html/colorado.html [moved from utils/test/reporting/colorado.html with 72% similarity]
utils/test/reporting/html/danube.html [moved from utils/test/reporting/danube.html with 72% similarity]
utils/test/reporting/html/elements.html [moved from utils/test/reporting/elements.html with 76% similarity]
utils/test/reporting/html/functest-colorado.html [moved from utils/test/reporting/functest-colorado.html with 68% similarity]
utils/test/reporting/html/functest-master.html [moved from utils/test/reporting/functest-master.html with 68% similarity]
utils/test/reporting/html/generic.html [moved from utils/test/reporting/generic.html with 83% similarity]
utils/test/reporting/html/index.html [moved from utils/test/reporting/index.html with 74% similarity]
utils/test/reporting/img/colorado.jpg [moved from utils/test/reporting/images/colorado.jpg with 100% similarity]
utils/test/reporting/img/danube.jpg [moved from utils/test/reporting/images/danube.jpg with 100% similarity]
utils/test/reporting/img/functest.jpg [moved from utils/test/reporting/images/functest.jpg with 100% similarity]
utils/test/reporting/img/functest.jpg.old [moved from utils/test/reporting/images/functest.jpg.old with 100% similarity]
utils/test/reporting/img/gauge_0.png [new file with mode: 0644]
utils/test/reporting/img/gauge_100.png [new file with mode: 0644]
utils/test/reporting/img/gauge_16.7.png [new file with mode: 0644]
utils/test/reporting/img/gauge_25.png [new file with mode: 0644]
utils/test/reporting/img/gauge_33.3.png [new file with mode: 0644]
utils/test/reporting/img/gauge_41.7.png [new file with mode: 0644]
utils/test/reporting/img/gauge_50.png [new file with mode: 0644]
utils/test/reporting/img/gauge_58.3.png [new file with mode: 0644]
utils/test/reporting/img/gauge_66.7.png [new file with mode: 0644]
utils/test/reporting/img/gauge_75.png [new file with mode: 0644]
utils/test/reporting/img/gauge_8.3.png [new file with mode: 0644]
utils/test/reporting/img/gauge_83.3.png [new file with mode: 0644]
utils/test/reporting/img/gauge_91.7.png [new file with mode: 0644]
utils/test/reporting/img/icon-nok.png [new file with mode: 0644]
utils/test/reporting/img/icon-ok.png [new file with mode: 0644]
utils/test/reporting/img/logo.svg [moved from utils/test/reporting/images/logo.svg with 100% similarity]
utils/test/reporting/img/pic01.jpg [moved from utils/test/reporting/images/pic01.jpg with 100% similarity]
utils/test/reporting/img/pic02.jpg [moved from utils/test/reporting/images/pic02.jpg with 100% similarity]
utils/test/reporting/img/pic03.jpg [moved from utils/test/reporting/images/pic03.jpg with 100% similarity]
utils/test/reporting/img/pic04.jpg [moved from utils/test/reporting/images/pic04.jpg with 100% similarity]
utils/test/reporting/img/pic05.jpg [moved from utils/test/reporting/images/pic05.jpg with 100% similarity]
utils/test/reporting/img/pic06.jpg [moved from utils/test/reporting/images/pic06.jpg with 100% similarity]
utils/test/reporting/img/pic07.jpg [moved from utils/test/reporting/images/pic07.jpg with 100% similarity]
utils/test/reporting/img/pic08.jpg [moved from utils/test/reporting/images/pic08.jpg with 100% similarity]
utils/test/reporting/img/pic09.jpg [moved from utils/test/reporting/images/pic09.jpg with 100% similarity]
utils/test/reporting/img/pic10.jpg [moved from utils/test/reporting/images/pic10.jpg with 100% similarity]
utils/test/reporting/img/pic11.jpg [moved from utils/test/reporting/images/pic11.jpg with 100% similarity]
utils/test/reporting/img/pic12.jpg [moved from utils/test/reporting/images/pic12.jpg with 100% similarity]
utils/test/reporting/img/pic13.jpg [moved from utils/test/reporting/images/pic13.jpg with 100% similarity]
utils/test/reporting/img/pic14.jpg [moved from utils/test/reporting/images/pic14.jpg with 100% similarity]
utils/test/reporting/img/pic15.jpg [moved from utils/test/reporting/images/pic15.jpg with 100% similarity]
utils/test/reporting/img/weather-clear.png [new file with mode: 0644]
utils/test/reporting/img/weather-few-clouds.png [new file with mode: 0644]
utils/test/reporting/img/weather-overcast.png [new file with mode: 0644]
utils/test/reporting/img/weather-storm.png [new file with mode: 0644]
utils/test/reporting/img/yardstick.jpg [moved from utils/test/reporting/images/yardstick.jpg with 100% similarity]
utils/test/reporting/reporting.yaml [new file with mode: 0644]
utils/test/reporting/run_unit_tests.sh [new file with mode: 0755]
utils/test/reporting/setup.py [new file with mode: 0644]
utils/test/reporting/tests/__init__.py [new file with mode: 0644]
utils/test/reporting/tests/unit/__init__.py [new file with mode: 0644]
utils/test/reporting/tests/unit/utils/__init__.py [new file with mode: 0644]
utils/test/reporting/tests/unit/utils/test_utils.py [new file with mode: 0644]
utils/test/reporting/utils/__init__.py [new file with mode: 0644]
utils/test/reporting/utils/reporting_utils.py [new file with mode: 0644]
utils/test/reporting/yardstick/reporting-status.py
utils/test/reporting/yardstick/reportingConf.py [deleted file]
utils/test/reporting/yardstick/reportingUtils.py [deleted file]
utils/test/reporting/yardstick/scenarios.py
utils/test/reporting/yardstick/template/index-status-tmpl.html

diff --git a/utils/test/reporting/docker/Dockerfile b/utils/test/reporting/docker/Dockerfile
new file mode 100644 (file)
index 0000000..789df91
--- /dev/null
@@ -0,0 +1,43 @@
+########################################
+#   Docker container for OPNFV-REPORTING
+########################################
+# Purpose: run opnfv-reporting to provide consistent Testing reporting
+#
+# Maintained by Morgan Richomme
+# Build:
+#    $ docker build -t opnfv/testreporting:tag .
+##
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+FROM nginx:stable
+
+MAINTAINER Morgan Richomme <morgan.richomme@orange.com>
+LABEL version="danube.1.0" description="OPNFV Test Reporting Docker container"
+
+ARG BRANCH=master
+
+ENV HOME /home/opnfv
+ENV working_dir /home/opnfv/utils/test/reporting
+ENV TERM xterm
+ENV COLORTERM gnome-terminal
+ENV CONFIG_REPORTING_YAML /home/opnfv/utils/test/reporting/reporting.yaml
+
+# Packaged dependencies
+RUN apt-get update && apt-get install -y \
+ssh \
+git-core \
+wkhtmltopdf \
+--no-install-recommends
+
+RUN pip install --upgrade pip
+
+RUN pip install -r ${working_dir}/docker/requirements.txt
+RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng /home/opnfv
+
+WORKDIR ${working_dir}
+CMD ["bash", "./docker/reporting.sh"]
+CMD ["bash", "mv display /usr/share/nginx/html"]
diff --git a/utils/test/reporting/docker/reporting.sh b/utils/test/reporting/docker/reporting.sh
new file mode 100755 (executable)
index 0000000..5d4ea11
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/bash
+cd ..
+
+export PYTHONPATH="${PYTHONPATH}:."
+export CONFIG_REPORTING_YAML=./reporting.yaml
+
+declare -a versions=(colorado master)
+declare -a projects=(functest yardstick)
+
+project=$1
+reporting_type=$2
+
+# create Directories if needed
+for i in "${versions[@]}"
+do
+    for j in "${projects[@]}"
+       do
+           mkdir -p display/$i/$j
+       done
+done
+
+# copy images, js, css, 3rd_party
+cp -Rf 3rd_party display  
+cp -Rf css display
+cp -Rf html/* display
+cp -Rf img display
+cp -Rf js display
+
+# if nothing is precised run all the reporting generation
+#  projet   |        option
+#   $1      |          $2
+# functest  | status, vims, tempest
+# yardstick |
+
+if [ -z "$1" ]; then
+  echo "********************************"
+  echo " Functest reporting " 
+  echo "********************************"
+  echo "reporting vIMS..."
+  python ./functest/reporting-vims.py
+  echo "reporting vIMS...OK"
+  sleep 10
+  echo "reporting Tempest..."
+  python ./functest/reporting-tempest.py
+  echo "reporting Tempest...OK"
+  sleep 10
+  echo "reporting status..."
+  python ./functest/reporting-status.py
+  echo "Functest reporting status...OK"
+
+  echo "********************************"
+  echo " Yardstick reporting " 
+  echo "********************************"
+  python ./yardstick/reporting-status.py
+  echo "Yardstick reporting status...OK"
+else
+  if [ -z "$2" ]; then
+    reporting_type="status"
+  fi
+  echo "********************************"
+  echo " $project/$reporting_type reporting " 
+  echo "********************************"
+  python ./$project/reporting-$reporting_type.py
+fi
+
diff --git a/utils/test/reporting/docker/requirements.pip b/utils/test/reporting/docker/requirements.pip
new file mode 100644 (file)
index 0000000..21d5ba9
--- /dev/null
@@ -0,0 +1,12 @@
+#
+#
+# author: Morgan Richomme (morgan.richomme@orange.com)
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+pdfkit==0.5.0
+PyYAML==3.11
+simplejson==3.8.1
index 653448e..cb13b09 100755 (executable)
@@ -8,19 +8,20 @@
 #
 import datetime
 import jinja2
-import pdfkit
+import os
 import requests
 import sys
 import time
 import yaml
 
-import reportingUtils as utils
-import reportingConf as conf
 import testCase as tc
 import scenarioResult as sr
 
+# manage conf
+import utils.reporting_utils as rp_utils
+
 # Logger
-logger = utils.getLogger("Status")
+logger = rp_utils.getLogger("Functest-Status")
 
 # Initialization
 testValid = []
@@ -33,14 +34,21 @@ tempest = tc.TestCase("tempest_smoke_serial", "functest", -1)
 
 # Retrieve the Functest configuration to detect which tests are relevant
 # according to the installer, scenario
-cf = conf.TEST_CONF
+cf = rp_utils.get_config('functest.test_conf')
+period = rp_utils.get_config('general.period')
+versions = rp_utils.get_config('general.versions')
+installers = rp_utils.get_config('general.installers')
+blacklist = rp_utils.get_config('functest.blacklist')
+log_level = rp_utils.get_config('general.log.log_level')
 response = requests.get(cf)
 
 functest_yaml_config = yaml.safe_load(response.text)
 
 logger.info("*******************************************")
+logger.info("*                                         *")
 logger.info("*   Generating reporting scenario status  *")
-logger.info("*   Data retention = %s days              *" % conf.PERIOD)
+logger.info("*   Data retention: %s days               *" % period)
+logger.info("*   Log level: %s                       *" % log_level)
 logger.info("*                                         *")
 logger.info("*******************************************")
 
@@ -55,36 +63,41 @@ config_tiers = functest_yaml_config.get("tiers")
 for tier in config_tiers:
     if tier['order'] > 0 and tier['order'] < 3:
         for case in tier['testcases']:
-            if case['name'] not in conf.blacklist:
+            if case['name'] not in blacklist:
                 testValid.append(tc.TestCase(case['name'],
                                              "functest",
                                              case['dependencies']))
     elif tier['order'] == 3:
         for case in tier['testcases']:
-            if case['name'] not in conf.blacklist:
+            if case['name'] not in blacklist:
                 testValid.append(tc.TestCase(case['name'],
                                              case['name'],
                                              case['dependencies']))
     elif tier['order'] > 3:
         for case in tier['testcases']:
-            if case['name'] not in conf.blacklist:
+            if case['name'] not in blacklist:
                 otherTestCases.append(tc.TestCase(case['name'],
                                                   "functest",
                                                   case['dependencies']))
 
+logger.debug("Functest reporting start")
 # For all the versions
-for version in conf.versions:
+for version in versions:
     # For all the installers
-    for installer in conf.installers:
+    for installer in installers:
         # get scenarios
-        scenario_results = utils.getScenarios(tempest, installer, version)
-        scenario_stats = utils.getScenarioStats(scenario_results)
+        scenario_results = rp_utils.getScenarios(tempest, installer, version)
+        scenario_stats = rp_utils.getScenarioStats(scenario_results)
         items = {}
         scenario_result_criteria = {}
 
-        scenario_file_name = (conf.REPORTING_PATH +
-                              "/functest/release/" + version +
-                              "/scenario_history.txt")
+        scenario_file_name = ("./display/" + version +
+                              "/functest/scenario_history.txt")
+        # initiate scenario file if it does not exist
+        if not os.path.isfile(scenario_file_name):
+            with open(scenario_file_name, "a") as my_file:
+                logger.debug("Create scenario file: %s" % scenario_file_name)
+                my_file.write("date,scenario,installer,detail,score\n")
 
         # For all the scenarios get results
         for s, s_result in scenario_results.items():
@@ -102,7 +115,7 @@ for version in conf.versions:
             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 = utils.getJenkinsUrl(build_tag)
+                s_url = s_url = rp_utils.getJenkinsUrl(build_tag)
                 logger.info("last jenkins url: %s" % s_url)
             testCases2BeDisplayed = []
             # Check if test case is runnable / installer, scenario
@@ -126,7 +139,8 @@ for version in conf.versions:
                         nb_test_runnable_for_this_scenario += 1
                         logger.info(" Searching results for case %s " %
                                     (displayName))
-                        result = utils.getResult(dbName, installer, s, version)
+                        result = rp_utils.getResult(dbName, installer,
+                                                    s, version)
                         # if no result set the value to 0
                         if result < 0:
                             result = 0
@@ -158,7 +172,8 @@ for version in conf.versions:
                         project = test_case.getProject()
                         logger.info(" Searching results for case %s " %
                                     (displayName))
-                        result = utils.getResult(dbName, installer, s, version)
+                        result = rp_utils.getResult(dbName, installer,
+                                                    s, version)
                         # at least 1 result for the test
                         if result > -1:
                             test_case.setCriteria(result)
@@ -186,11 +201,11 @@ for version in conf.versions:
             scenario_criteria = nb_test_runnable_for_this_scenario * 3
             # if 0 runnable tests set criteria at a high value
             if scenario_criteria < 1:
-                scenario_criteria = conf.MAX_SCENARIO_CRITERIA
+                scenario_criteria = 50  # conf.MAX_SCENARIO_CRITERIA
 
             s_score = str(scenario_score) + "/" + str(scenario_criteria)
-            s_score_percent = utils.getScenarioPercent(scenario_score,
-                                                       scenario_criteria)
+            s_score_percent = rp_utils.getScenarioPercent(scenario_score,
+                                                          scenario_criteria)
 
             s_status = "KO"
             if scenario_score < scenario_criteria:
@@ -200,9 +215,9 @@ for version in conf.versions:
             else:
                 logger.info(">>>>> scenario OK, save the information")
                 s_status = "OK"
-                path_validation_file = (conf.REPORTING_PATH +
-                                        "/functest/release/" + version +
-                                        "/validated_scenario_history.txt")
+                path_validation_file = ("./display/" + version +
+                                        "/functest/" +
+                                        "validated_scenario_history.txt")
                 with open(path_validation_file, "a") as f:
                     time_format = "%Y-%m-%d %H:%M"
                     info = (datetime.datetime.now().strftime(time_format) +
@@ -222,54 +237,37 @@ for version in conf.versions:
                                                             s_url)
             logger.info("--------------------------")
 
-        templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH)
+        templateLoader = jinja2.FileSystemLoader(".")
         templateEnv = jinja2.Environment(
             loader=templateLoader, autoescape=True)
 
-        TEMPLATE_FILE = "/functest/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,
                                      scenario_results=scenario_result_criteria,
                                      items=items,
                                      installer=installer,
-                                     period=conf.PERIOD,
+                                     period=period,
                                      version=version,
                                      date=reportingDate)
 
-        # 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, "a")
-        logger.info("Generate CSV...")
-        with open(scenario_file_name, "r") as f:
-            for line in f:
-                if installer in line:
-                    logger.debug("Add new line... %s" % line)
-                    scenario_installer_file.write(line)
-        scenario_installer_file.close
-
-        with open(conf.REPORTING_PATH + "/functest/release/" + version +
-                  "/index-status-" + installer + ".html", "wb") as fh:
+        with open("./display/" + version +
+                  "/functest/status-" + installer + ".html", "wb") as fh:
             fh.write(outputText)
-        logger.info("CSV generated...")
+
+        logger.info("Manage export CSV & PDF")
+        rp_utils.export_csv(scenario_file_name, installer, version)
+        logger.error("CSV generated...")
 
         # Generate outputs for export
         # pdf
-        logger.info("Generate 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)
-            logger.info("PDF generated...")
-        except IOError:
-            logger.info("pdf generated anyway...")
-        except:
-            logger.error("impossible to generate PDF")
+        # TODO Change once web site updated...use the current one
+        # to test pdf production
+        url_pdf = rp_utils.get_config('general.url')
+        pdf_path = ("./display/" + version +
+                    "/functest/status-" + installer + ".html")
+        pdf_doc_name = ("./display/" + version +
+                        "/functest/status-" + installer + ".pdf")
+        rp_utils.export_pdf(pdf_path, pdf_doc_name)
+        logger.info("PDF generated...")
index 363f123..5d6bcc0 100755 (executable)
@@ -1,18 +1,22 @@
 from urllib2 import Request, urlopen, URLError
 import json
 import jinja2
-import reportingConf as conf
-import reportingUtils as utils
+import os
 
-installers = conf.installers
+# manage conf
+import utils.reporting_utils as rp_utils
+
+installers = rp_utils.get_config('general.installers')
 items = ["tests", "Success rate", "duration"]
 
-PERIOD = conf.PERIOD
+CURRENT_DIR = os.getcwd()
+
+PERIOD = rp_utils.get_config('general.period')
 criteria_nb_test = 165
 criteria_duration = 1800
 criteria_success_rate = 90
 
-logger = utils.getLogger("Tempest")
+logger = rp_utils.getLogger("Tempest")
 logger.info("************************************************")
 logger.info("*   Generating reporting Tempest_smoke_serial  *")
 logger.info("*   Data retention = %s days                   *" % PERIOD)
@@ -25,10 +29,11 @@ logger.info("test duration < %s s " % criteria_duration)
 logger.info("success rate > %s " % criteria_success_rate)
 
 # For all the versions
-for version in conf.versions:
-    for installer in conf.installers:
+for version in rp_utils.get_config('general.versions'):
+    for installer in installers:
         # we consider the Tempest results of the last PERIOD days
-        url = 'http://' + conf.URL_BASE + "?case=tempest_smoke_serial"
+        url = ("http://" + rp_utils.get_config('testapi.url') +
+               "?case=tempest_smoke_serial")
         request = Request(url + '&period=' + str(PERIOD) +
                           '&installer=' + installer +
                           '&version=' + version)
@@ -68,8 +73,9 @@ for version in conf.versions:
                 nb_tests_run = result['details']['tests']
                 nb_tests_failed = result['details']['failures']
                 if nb_tests_run != 0:
-                    success_rate = 100*(int(nb_tests_run) -
-                                        int(nb_tests_failed)) / int(nb_tests_run)
+                    success_rate = 100*((int(nb_tests_run) -
+                                        int(nb_tests_failed)) /
+                                        int(nb_tests_run))
                 else:
                     success_rate = 0
 
@@ -115,17 +121,18 @@ for version in conf.versions:
                 except:
                     logger.error("Error field not present (Brahamputra runs?)")
 
-        templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH)
-        templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True)
+        templateLoader = jinja2.FileSystemLoader(".")
+        templateEnv = jinja2.Environment(loader=templateLoader,
+                                         autoescape=True)
 
-        TEMPLATE_FILE = "/template/index-tempest-tmpl.html"
+        TEMPLATE_FILE = "./functest/template/index-tempest-tmpl.html"
         template = templateEnv.get_template(TEMPLATE_FILE)
 
         outputText = template.render(scenario_results=scenario_results,
                                      items=items,
                                      installer=installer)
 
-        with open(conf.REPORTING_PATH + "/release/" + version +
-                  "/index-tempest-" + installer + ".html", "wb") as fh:
+        with open("./display/" + version +
+                  "/functest/tempest-" + installer + ".html", "wb") as fh:
             fh.write(outputText)
 logger.info("Tempest automatic reporting succesfully generated.")
index 430a545..2077d2a 100755 (executable)
@@ -1,10 +1,11 @@
 from urllib2 import Request, urlopen, URLError
 import json
 import jinja2
-import reportingConf as conf
-import reportingUtils as utils
 
-logger = utils.getLogger("vIMS")
+# manage conf
+import utils.reporting_utils as rp_utils
+
+logger = rp_utils.getLogger("vIMS")
 
 
 def sig_test_format(sig_test):
@@ -24,22 +25,26 @@ def sig_test_format(sig_test):
     total_sig_test_result['skipped'] = nbSkipped
     return total_sig_test_result
 
+period = rp_utils.get_config('general.period')
+versions = rp_utils.get_config('general.versions')
+url_base = rp_utils.get_config('testapi.url')
+
 logger.info("****************************************")
 logger.info("*   Generating reporting vIMS          *")
-logger.info("*   Data retention = %s days           *" % conf.PERIOD)
+logger.info("*   Data retention = %s days           *" % period)
 logger.info("*                                      *")
 logger.info("****************************************")
 
-installers = conf.installers
+installers = rp_utils.get_config('general.installers')
 step_order = ["initialisation", "orchestrator", "vIMS", "sig_test"]
 logger.info("Start processing....")
 
 # For all the versions
-for version in conf.versions:
+for version in versions:
     for installer in installers:
         logger.info("Search vIMS results for installer: %s, version: %s"
                     % (installer, version))
-        request = Request("http://" + conf.URL_BASE + '?case=vims&installer=' +
+        request = Request("http://" + url_base + '?case=vims&installer=' +
                           installer + '&version=' + version)
 
         try:
@@ -81,7 +86,8 @@ for version in conf.versions:
                     if int(m) != 0:
                         m_display += str(int(m)) + "m "
 
-                    step_result['duration_display'] = m_display + str(int(s)) + "s"
+                    step_result['duration_display'] = (m_display +
+                                                       str(int(s)) + "s")
 
                 result['pr_step_ok'] = 0
                 if nb_step != 0:
@@ -89,8 +95,9 @@ for version in conf.versions:
                 try:
                     logger.debug("Scenario %s, Installer %s"
                                  % (s_result[1]['scenario'], installer))
+                    res = result['details']['orchestrator']['duration']
                     logger.debug("Orchestrator deployment: %s s"
-                                 % result['details']['orchestrator']['duration'])
+                                 % res)
                     logger.debug("vIMS deployment: %s s"
                                  % result['details']['vIMS']['duration'])
                     logger.debug("Signaling testing: %s s"
@@ -101,18 +108,18 @@ for version in conf.versions:
                     logger.error("Data badly formatted")
                 logger.debug("----------------------------------------")
 
-        templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH)
-        templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True)
+        templateLoader = jinja2.FileSystemLoader(".")
+        templateEnv = jinja2.Environment(loader=templateLoader,
+                                         autoescape=True)
 
-        TEMPLATE_FILE = "/template/index-vims-tmpl.html"
+        TEMPLATE_FILE = "./functest/template/index-vims-tmpl.html"
         template = templateEnv.get_template(TEMPLATE_FILE)
 
         outputText = template.render(scenario_results=scenario_results,
                                      step_order=step_order,
                                      installer=installer)
 
-        with open(conf.REPORTING_PATH +
-                  "/release/" + version + "/index-vims-" +
+        with open("./display/" + version + "/functest/vims-" +
                   installer + ".html", "wb") as fh:
             fh.write(outputText)
 
diff --git a/utils/test/reporting/functest/reportingConf.py b/utils/test/reporting/functest/reportingConf.py
deleted file mode 100644 (file)
index 1c9a2ac..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/python
-#
-# This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Reporting: Declaration of the variables
-#
-# ****************************************************
-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 = ["master", "colorado"]
-PERIOD = 10
-MAX_SCENARIO_CRITERIA = 50
-# get the last 5 test results to determinate the success criteria
-NB_TESTS = 5
-# REPORTING_PATH = "/usr/share/nginx/html/reporting/functest"
-REPORTING_PATH = "."
-URL_BASE = 'testresults.opnfv.org/test/api/v1/results'
-TEST_CONF = "https://git.opnfv.org/cgit/functest/plain/ci/testcases.yaml"
-LOG_LEVEL = "ERROR"
-LOG_FILE = REPORTING_PATH + "/reporting.log"
diff --git a/utils/test/reporting/functest/reportingUtils.py b/utils/test/reporting/functest/reportingUtils.py
deleted file mode 100644 (file)
index 74d6f19..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/usr/bin/python
-#
-# This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-from urllib2 import Request, urlopen, URLError
-import logging
-import json
-import reportingConf as conf
-
-
-def getLogger(module):
-    logFormatter = logging.Formatter("%(asctime)s [" +
-                                     module +
-                                     "] [%(levelname)-5.5s]  %(message)s")
-    logger = logging.getLogger()
-
-    fileHandler = logging.FileHandler("{0}/{1}".format('.', conf.LOG_FILE))
-    fileHandler.setFormatter(logFormatter)
-    logger.addHandler(fileHandler)
-
-    consoleHandler = logging.StreamHandler()
-    consoleHandler.setFormatter(logFormatter)
-    logger.addHandler(consoleHandler)
-    logger.setLevel(conf.LOG_LEVEL)
-    return logger
-
-
-def getApiResults(case, installer, scenario, version):
-    results = json.dumps([])
-    # to remove proxy (to be removed at the end for local test only)
-    # proxy_handler = urllib2.ProxyHandler({})
-    # opener = urllib2.build_opener(proxy_handler)
-    # urllib2.install_opener(opener)
-    # url = "http://127.0.0.1:8000/results?case=" + case + \
-    #       "&period=30&installer=" + installer
-    url = ("http://" + conf.URL_BASE + "?case=" + case +
-           "&period=" + str(conf.PERIOD) + "&installer=" + installer +
-           "&scenario=" + scenario + "&version=" + version +
-           "&last=" + str(conf.NB_TESTS))
-    request = Request(url)
-
-    try:
-        response = urlopen(request)
-        k = response.read()
-        results = json.loads(k)
-    except URLError, e:
-        print 'No kittez. Got an error code:', e
-
-    return results
-
-
-def getScenarios(case, installer, version):
-
-    case = case.getName()
-    url = ("http://" + conf.URL_BASE + "?case=" + case +
-           "&period=" + str(conf.PERIOD) + "&installer=" + installer +
-           "&version=" + version)
-    request = Request(url)
-
-    try:
-        response = urlopen(request)
-        k = response.read()
-        results = json.loads(k)
-        test_results = results['results']
-    except URLError, e:
-        print 'Got an error code:', e
-
-    if test_results is not None:
-        test_results.reverse()
-
-        scenario_results = {}
-
-        for r in test_results:
-            # Retrieve all the scenarios per installer
-            if not r['scenario'] in scenario_results.keys():
-                scenario_results[r['scenario']] = []
-            scenario_results[r['scenario']].append(r)
-
-    return scenario_results
-
-
-def getScenarioStats(scenario_results):
-    scenario_stats = {}
-    for k, v in scenario_results.iteritems():
-        scenario_stats[k] = len(v)
-
-    return scenario_stats
-
-
-def getNbtestOk(results):
-    nb_test_ok = 0
-    for r in results:
-        for k, v in r.iteritems():
-            try:
-                if "PASS" in v:
-                    nb_test_ok += 1
-            except:
-                print "Cannot retrieve test status"
-    return nb_test_ok
-
-
-def getResult(testCase, installer, scenario, version):
-
-    # retrieve raw results
-    results = getApiResults(testCase, installer, scenario, version)
-    # let's concentrate on test results only
-    test_results = results['results']
-
-    # if results found, analyze them
-    if test_results is not None:
-        test_results.reverse()
-
-        scenario_results = []
-
-        # print " ---------------- "
-        # print test_results
-        # print " ---------------- "
-        # print "nb of results:" + str(len(test_results))
-
-        for r in test_results:
-            # print r["start_date"]
-            # print r["criteria"]
-            scenario_results.append({r["start_date"]: r["criteria"]})
-        # sort results
-        scenario_results.sort()
-        # 4 levels for the results
-        # 3: 4+ consecutive runs passing the success criteria
-        # 2: <4 successful consecutive runs but passing the criteria
-        # 1: close to pass the success criteria
-        # 0: 0% success, not passing
-        # -1: no run available
-        test_result_indicator = 0
-        nbTestOk = getNbtestOk(scenario_results)
-
-        # print "Nb test OK (last 10 days):"+ str(nbTestOk)
-        # check that we have at least 4 runs
-        if len(scenario_results) < 1:
-            # No results available
-            test_result_indicator = -1
-        elif nbTestOk < 1:
-            test_result_indicator = 0
-        elif nbTestOk < 2:
-            test_result_indicator = 1
-        else:
-            # Test the last 4 run
-            if (len(scenario_results) > 3):
-                last4runResults = scenario_results[-4:]
-                nbTestOkLast4 = getNbtestOk(last4runResults)
-                # print "Nb test OK (last 4 run):"+ str(nbTestOkLast4)
-                if nbTestOkLast4 > 3:
-                    test_result_indicator = 3
-                else:
-                    test_result_indicator = 2
-            else:
-                test_result_indicator = 2
-    return test_result_indicator
-
-
-def getJenkinsUrl(build_tag):
-    # e.g. jenkins-functest-apex-apex-daily-colorado-daily-colorado-246
-    # id = 246
-    # note it is linked to jenkins format
-    # if this format changes...function to be adapted....
-    url_base = "https://build.opnfv.org/ci/view/functest/job/"
-    jenkins_url = ""
-    try:
-        build_id = [int(s) for s in build_tag.split("-") if s.isdigit()]
-        jenkins_path = filter(lambda c: not c.isdigit(), build_tag)
-        url_id = jenkins_path[8:-1] + "/" + str(build_id[0])
-        jenkins_url = url_base + url_id + "/console"
-    except:
-        print 'Impossible to get jenkins url:'
-
-    return jenkins_url
-
-def getScenarioPercent(scenario_score,scenario_criteria):
-    score = 0.0
-    try:
-        score = float(scenario_score) / float(scenario_criteria) * 100
-    except:
-        print 'Impossible to calculate the percentage score'
-    return score
index e3c9c5f..094bbf8 100644 (file)
@@ -3,12 +3,12 @@
     <meta charset="utf-8">
     <!-- Bootstrap core CSS -->
     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
-    <link href="../../../css/default.css" rel="stylesheet">
+    <link href="../../css/default.css" rel="stylesheet">
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
     <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
     <script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
-    <script type="text/javascript" src="../../../js/gauge.js"></script>
-    <script type="text/javascript" src="../../../js/trend.js"></script>
+    <script type="text/javascript" src="../../js/gauge.js"></script>
+    <script type="text/javascript" src="../../js/trend.js"></script>
     <script>
     function onDocumentReady() {
        // Gauge management
@@ -26,7 +26,7 @@
         }
         
         // trend line management
-        d3.csv("./scenario_history.txt", function(data) {
+        d3.csv("./scenario_history.csv", function(data) {
        // ***************************************
        // Create the trend line
       {% for scenario,iteration in scenario_stats.iteritems() -%}
@@ -69,11 +69,11 @@ $(document).ready(function (){
         <h3 class="text-muted">Functest status page ({{version}}, {{date}})</h3>
         <nav>
           <ul class="nav nav-justified">
-            <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
-            <li><a href="index-status-apex.html">Apex</a></li>
-            <li><a href="index-status-compass.html">Compass</a></li>
-            <li><a href="index-status-fuel.html">Fuel</a></li>
-            <li><a href="index-status-joid.html">Joid</a></li>
+            <li class="active"><a href="../../index.html">Home</a></li>
+            <li><a href="status-apex.html">Apex</a></li>
+            <li><a href="status-compass.html">Compass</a></li>
+            <li><a href="status-fuel.html">Fuel</a></li>
+            <li><a href="status-joid.html">Joid</a></li>
           </ul>
         </nav>
       </div>
@@ -133,13 +133,13 @@ $(document).ready(function (){
                         <tr class="tr-weather-weather">
                             {% for test in items[scenario] -%}
                             {% if test.getCriteria() > 2 -%}
-                                <td><img src="../../img/weather-clear.png"></td>
+                                <td><img src="../../../img/weather-clear.png"></td>
                             {%- elif test.getCriteria() > 1 -%}
-                                <td><img src="../../img/weather-few-clouds.png"></td>
+                                <td><img src="../../../img/weather-few-clouds.png"></td>
                             {%- elif test.getCriteria() > 0 -%}
-                                <td><img src="../../img/weather-overcast.png"></td>
+                                <td><img src="../../../img/weather-overcast.png"></td>
                             {%- elif test.getCriteria() > -1 -%}
-                                <td><img src="../../img/weather-storm.png"></td>
+                                <td><img src="../../../img/weather-storm.png"></td>
                             {%- endif %}
                             {%- endfor %}
                         </tr>
index 42d7ed3..db48307 100644 (file)
@@ -3,7 +3,7 @@
     <meta charset="utf-8">
     <!-- Bootstrap core CSS -->
     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
-    <link href="default.css" rel="stylesheet">
+    <link href="../../css/default.css" rel="stylesheet">
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
     <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
     <script type="text/javascript">
         <h3 class="text-muted">Tempest status page</h3>
         <nav>
           <ul class="nav nav-justified">
-            <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
-            <li><a href="index-tempest-apex.html">Apex</a></li>
-            <li><a href="index-tempest-compass.html">Compass</a></li>
-            <li><a href="index-tempest-fuel.html">Fuel</a></li>
-            <li><a href="index-tempest-joid.html">Joid</a></li>
+            <li class="active"><a href="../../index.html">Home</a></li>
+            <li><a href="tempest-apex.html">Apex</a></li>
+            <li><a href="tempest-compass.html">Compass</a></li>
+            <li><a href="tempest-fuel.html">Fuel</a></li>
+            <li><a href="tempest-joid.html">Joid</a></li>
           </ul>
         </nav>
       </div>
index 3836be9..033c8ab 100644 (file)
@@ -3,7 +3,7 @@
     <meta charset="utf-8">
     <!-- Bootstrap core CSS -->
     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
-    <link href="default.css" rel="stylesheet">
+    <link href="../../css/default.css" rel="stylesheet">
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
     <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
     <script type="text/javascript">
         <h3 class="text-muted">vIMS status page</h3>
         <nav>
           <ul class="nav nav-justified">
-            <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
-            <li><a href="index-vims-fuel.html">Fuel</a></li>
-            <li><a href="index-vims-compass.html">Compass</a></li>
-            <li><a href="index-vims-joid.html">JOID</a></li>
-            <li><a href="index-vims-apex.html">APEX</a></li>
+            <li class="active"><a href="../../index.html">Home</a></li>
+            <li><a href="vims-fuel.html">Fuel</a></li>
+            <li><a href="vims-compass.html">Compass</a></li>
+            <li><a href="vims-joid.html">JOID</a></li>
+            <li><a href="vims-apex.html">APEX</a></li>
           </ul>
         </nav>
       </div>
index a906f0d..64c7b9a 100644 (file)
@@ -40,7 +40,7 @@ class TestCase(object):
                                'domino': 'domino',
                                'odl-sfc': 'SFC',
                                'onos_sfc': 'SFC',
-                               'parser':'parser'
+                               'parser': 'parser'
                                }
         try:
             self.displayName = display_name_matrix[self.name]
@@ -133,7 +133,7 @@ class TestCase(object):
                              'domino': 'domino-multinode',
                              'odl-sfc': 'odl-sfc',
                              'onos_sfc': 'onos_sfc',
-                             'parser':'parser-basics'
+                             'parser': 'parser-basics'
                              }
         try:
             return test_match_matrix[self.name]
similarity index 72%
rename from utils/test/reporting/colorado.html
rename to utils/test/reporting/html/colorado.html
index 6d66939..ad1cdd4 100644 (file)
@@ -9,10 +9,10 @@
                <title>Phantom by HTML5 UP</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -56,7 +56,7 @@
                                                        <section class="tiles">\r
                                                                <article class="style3">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/functest.jpg" alt="" />\r
+                                                                               <img src="img/functest.jpg" alt="" />\r
                                                                        </span>\r
                                                                        <a href="functest-colorado.html">\r
                                                                                <h2>Functest</h2>\r
@@ -67,9 +67,9 @@
                                                                </article>\r
                                                                <article class="style2">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/yardstick.jpg" alt="" />\r
+                                                                               <img src="img/yardstick.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/yardstick/release/colorado/index-status-apex.html">\r
+                                                                       <a href="colorado/yardstick/status-apex.html">\r
                                                                                <h2>Yardstick</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Qualification and performance testing</p>\r
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
 </html>\r
similarity index 72%
rename from utils/test/reporting/danube.html
rename to utils/test/reporting/html/danube.html
index 70cd857..58d6bc0 100644 (file)
@@ -9,10 +9,10 @@
                <title>Phantom by HTML5 UP</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -56,7 +56,7 @@
                                                        <section class="tiles">\r
                                                                <article class="style3">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/functest.jpg" alt="" />\r
+                                                                               <img src="img/functest.jpg" alt="" />\r
                                                                        </span>\r
                                                                        <a href="functest-master.html">\r
                                                                                <h2>Functest</h2>\r
@@ -67,9 +67,9 @@
                                                                </article>\r
                                                                <article class="style2">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/yardstick.jpg" alt="" />\r
+                                                                               <img src="img/yardstick.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/yardstick/release/master/index-status-apex.html">\r
+                                                                       <a href="master/yardstick/status-apex.html">\r
                                                                                <h2>Yardstick</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Qualification and performance testing</p>\r
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
 </html>\r
similarity index 76%
rename from utils/test/reporting/elements.html
rename to utils/test/reporting/html/elements.html
index 3bfbfc1..7b9bb4d 100644 (file)
@@ -9,10 +9,10 @@
                <title>Elements - Phantom by HTML5 UP</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -347,21 +347,21 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre>
                                                                        <h3>Fit</h3>\r
                                                                        <div class="box alt">\r
                                                                                <div class="row uniform">\r
-                                                                                       <div class="12u$"><span class="image fit"><img src="images/pic13.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u"><span class="image fit"><img src="images/pic01.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u"><span class="image fit"><img src="images/pic02.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u$"><span class="image fit"><img src="images/pic03.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u"><span class="image fit"><img src="images/pic03.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u"><span class="image fit"><img src="images/pic01.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u$"><span class="image fit"><img src="images/pic02.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u"><span class="image fit"><img src="images/pic02.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u"><span class="image fit"><img src="images/pic03.jpg" alt="" /></span></div>\r
-                                                                                       <div class="4u$"><span class="image fit"><img src="images/pic01.jpg" alt="" /></span></div>\r
+                                                                                       <div class="12u$"><span class="image fit"><img src="img/pic13.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u"><span class="image fit"><img src="img/pic01.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u"><span class="image fit"><img src="img/pic02.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u$"><span class="image fit"><img src="img/pic03.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u"><span class="image fit"><img src="img/pic03.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u"><span class="image fit"><img src="img/pic01.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u$"><span class="image fit"><img src="img/pic02.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u"><span class="image fit"><img src="img/pic02.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u"><span class="image fit"><img src="img/pic03.jpg" alt="" /></span></div>\r
+                                                                                       <div class="4u$"><span class="image fit"><img src="img/pic01.jpg" alt="" /></span></div>\r
                                                                                </div>\r
                                                                        </div>\r
                                                                        <h3>Left &amp; Right</h3>\r
-                                                                       <p><span class="image left"><img src="images/pic14.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>\r
-                                                                       <p><span class="image right"><img src="images/pic15.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>\r
+                                                                       <p><span class="image left"><img src="img/pic14.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>\r
+                                                                       <p><span class="image right"><img src="img/pic15.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>\r
                                                                </section>\r
 \r
                                                </div>\r
@@ -409,11 +409,11 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre>
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
-</html>
\ No newline at end of file
+</html>\r
@@ -9,10 +9,10 @@
                <title>Phantom by HTML5 UP</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -56,9 +56,9 @@
                                                        <section class="tiles">\r
                                                                <article class="style5">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/pic05.jpg" alt="" />\r
+                                                                               <img src="img/pic05.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/functest/release/colorado/index-status-apex.html">\r
+                                                                       <a href="colorado/functest/status-apex.html">\r
                                                                                <h2>Status</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Scenario status</p>\r
@@ -67,9 +67,9 @@
                                                                </article>\r
                                                                <article class="style2">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/pic02.jpg" alt="" />\r
+                                                                               <img src="img/pic02.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/functest/release/colorado/index-vims-apex.html">\r
+                                                                       <a href="colorado/functest/vims-apex.html">\r
                                                                                <h2>vIMS</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Virtual IMS</p>\r
@@ -78,9 +78,9 @@
                                                                </article>\r
                                                                <article class="style3">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/pic03.jpg" alt="" />\r
+                                                                               <img src="img/pic03.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/functest/release/colorado/index-tempest-apex.html">\r
+                                                                       <a href="colorado/functest/tempest-apex.html">\r
                                                                                <h2>Tempest</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Tempest OpenStack suite</p>\r
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
 </html>\r
similarity index 68%
rename from utils/test/reporting/functest-master.html
rename to utils/test/reporting/html/functest-master.html
index 125b8c3..03217a6 100644 (file)
@@ -9,10 +9,10 @@
                <title>Phantom by HTML5 UP</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -56,9 +56,9 @@
                                                        <section class="tiles">\r
                                                                <article class="style5">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/pic05.jpg" alt="" />\r
+                                                                               <img src="img/pic05.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/functest/release/master/index-status-apex.html">\r
+                                                                       <a href="master/status-apex.html">\r
                                                                                <h2>Status</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Scenario status</p>\r
@@ -67,9 +67,9 @@
                                                                </article>\r
                                                                <article class="style2">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/pic02.jpg" alt="" />\r
+                                                                               <img src="img/pic02.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/functest/release/master/index-vims-apex.html">\r
+                                                                       <a href="master/vims-apex.html">\r
                                                                                <h2>vIMS</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Virtual IMS</p>\r
@@ -78,9 +78,9 @@
                                                                </article>\r
                                                                <article class="style3">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/pic03.jpg" alt="" />\r
+                                                                               <img src="img/pic03.jpg" alt="" />\r
                                                                        </span>\r
-                                                                       <a href="http://testresults.opnfv.org/reporting/functest/release/master/index-tempest-apex.html">\r
+                                                                       <a href="master/tempest-apex.html">\r
                                                                                <h2>Tempest</h2>\r
                                                                                <div class="content">\r
                                                                                        <p>Tempest OpenStack suite</p>\r
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
 </html>\r
similarity index 83%
rename from utils/test/reporting/generic.html
rename to utils/test/reporting/html/generic.html
index 1351b2a..39273da 100644 (file)
@@ -9,10 +9,10 @@
                <title>Generic - Phantom by HTML5 UP</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -53,7 +53,7 @@
                                        <div id="main">\r
                                                <div class="inner">\r
                                                        <h1>Generic Page</h1>\r
-                                                       <span class="image main"><img src="images/pic13.jpg" alt="" /></span>\r
+                                                       <span class="image main"><img src="img/pic13.jpg" alt="" /></span>\r
                                                        <p>Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fergiat. Pellentesque in mi eu massa lacinia malesuada et a elit. Donec urna ex, lacinia in purus ac, pretium pulvinar mauris. Curabitur sapien risus, commodo eget turpis at, elementum convallis elit. Pellentesque enim turpis, hendrerit tristique.</p>\r
                                                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dapibus rutrum facilisis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam tristique libero eu nibh porttitor fermentum. Nullam venenatis erat id vehicula viverra. Nunc ultrices eros ut ultricies condimentum. Mauris risus lacus, blandit sit amet venenatis non, bibendum vitae dolor. Nunc lorem mauris, fringilla in aliquam at, euismod in lectus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In non lorem sit amet elit placerat maximus. Pellentesque aliquam maximus risus, vel venenatis mauris vehicula hendrerit.</p>\r
                                                        <p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fersapien risus, commodo eget turpis at, elementum convallis elit. Pellentesque enim turpis, hendrerit tristique lorem ipsum dolor.</p>\r
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
-</html>
\ No newline at end of file
+</html>\r
similarity index 74%
rename from utils/test/reporting/index.html
rename to utils/test/reporting/html/index.html
index 1fad2e3..b2b8b46 100644 (file)
@@ -9,10 +9,10 @@
                <title>OPNFV reporting</title>\r
                <meta charset="utf-8" />\r
                <meta name="viewport" content="width=device-width, initial-scale=1" />\r
-               <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->\r
-               <link rel="stylesheet" href="assets/css/main.css" />\r
-               <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->\r
-               <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->\r
+               <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->\r
+               <link rel="stylesheet" href="3rd_party/css/main.css" />\r
+               <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->\r
+               <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->\r
        </head>\r
        <body>\r
                <!-- Wrapper -->\r
@@ -24,7 +24,7 @@
 \r
                                                        <!-- Logo -->\r
                                                                <a href="index.html" class="logo">\r
-                                                                       <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
+                                                                       <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>\r
                                                                </a>\r
 \r
                                                        <!-- Nav -->\r
@@ -56,7 +56,7 @@
                                                        <section class="tiles">\r
                                                                <article class="style3">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/colorado.jpg" alt="" />\r
+                                                                               <img src="img/colorado.jpg" alt="" />\r
                                                                        </span>\r
                                                                        <a href="colorado.html">\r
                                                                                <h2>Colorado</h2>\r
@@ -67,7 +67,7 @@
                                                                </article>\r
                                                                <article class="style2">\r
                                                                        <span class="image">\r
-                                                                               <img src="images/danube.jpg" alt="" />\r
+                                                                               <img src="img/danube.jpg" alt="" />\r
                                                                        </span>\r
                                                                        <a href="danube.html">\r
                                                                                <h2>Danube</h2>\r
                        </div>\r
 \r
                <!-- Scripts -->\r
-                       <script src="assets/js/jquery.min.js"></script>\r
-                       <script src="assets/js/skel.min.js"></script>\r
-                       <script src="assets/js/util.js"></script>\r
-                       <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->\r
-                       <script src="assets/js/main.js"></script>\r
+                       <script src="3rd_party/js/jquery.min.js"></script>\r
+                       <script src="3rd_party/js/skel.min.js"></script>\r
+                       <script src="3rd_party/js/util.js"></script>\r
+                       <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->\r
+                       <script src="3rd_party/js/main.js"></script>\r
 \r
        </body>\r
 </html>\r
diff --git a/utils/test/reporting/img/gauge_0.png b/utils/test/reporting/img/gauge_0.png
new file mode 100644 (file)
index 0000000..ecefc0e
Binary files /dev/null and b/utils/test/reporting/img/gauge_0.png differ
diff --git a/utils/test/reporting/img/gauge_100.png b/utils/test/reporting/img/gauge_100.png
new file mode 100644 (file)
index 0000000..e199e15
Binary files /dev/null and b/utils/test/reporting/img/gauge_100.png differ
diff --git a/utils/test/reporting/img/gauge_16.7.png b/utils/test/reporting/img/gauge_16.7.png
new file mode 100644 (file)
index 0000000..3e3993c
Binary files /dev/null and b/utils/test/reporting/img/gauge_16.7.png differ
diff --git a/utils/test/reporting/img/gauge_25.png b/utils/test/reporting/img/gauge_25.png
new file mode 100644 (file)
index 0000000..4923659
Binary files /dev/null and b/utils/test/reporting/img/gauge_25.png differ
diff --git a/utils/test/reporting/img/gauge_33.3.png b/utils/test/reporting/img/gauge_33.3.png
new file mode 100644 (file)
index 0000000..364574b
Binary files /dev/null and b/utils/test/reporting/img/gauge_33.3.png differ
diff --git a/utils/test/reporting/img/gauge_41.7.png b/utils/test/reporting/img/gauge_41.7.png
new file mode 100644 (file)
index 0000000..8c3e910
Binary files /dev/null and b/utils/test/reporting/img/gauge_41.7.png differ
diff --git a/utils/test/reporting/img/gauge_50.png b/utils/test/reporting/img/gauge_50.png
new file mode 100644 (file)
index 0000000..2874b9f
Binary files /dev/null and b/utils/test/reporting/img/gauge_50.png differ
diff --git a/utils/test/reporting/img/gauge_58.3.png b/utils/test/reporting/img/gauge_58.3.png
new file mode 100644 (file)
index 0000000..beedc8a
Binary files /dev/null and b/utils/test/reporting/img/gauge_58.3.png differ
diff --git a/utils/test/reporting/img/gauge_66.7.png b/utils/test/reporting/img/gauge_66.7.png
new file mode 100644 (file)
index 0000000..93f44d1
Binary files /dev/null and b/utils/test/reporting/img/gauge_66.7.png differ
diff --git a/utils/test/reporting/img/gauge_75.png b/utils/test/reporting/img/gauge_75.png
new file mode 100644 (file)
index 0000000..9fc261f
Binary files /dev/null and b/utils/test/reporting/img/gauge_75.png differ
diff --git a/utils/test/reporting/img/gauge_8.3.png b/utils/test/reporting/img/gauge_8.3.png
new file mode 100644 (file)
index 0000000..59f8657
Binary files /dev/null and b/utils/test/reporting/img/gauge_8.3.png differ
diff --git a/utils/test/reporting/img/gauge_83.3.png b/utils/test/reporting/img/gauge_83.3.png
new file mode 100644 (file)
index 0000000..27ae4ec
Binary files /dev/null and b/utils/test/reporting/img/gauge_83.3.png differ
diff --git a/utils/test/reporting/img/gauge_91.7.png b/utils/test/reporting/img/gauge_91.7.png
new file mode 100644 (file)
index 0000000..2808657
Binary files /dev/null and b/utils/test/reporting/img/gauge_91.7.png differ
diff --git a/utils/test/reporting/img/icon-nok.png b/utils/test/reporting/img/icon-nok.png
new file mode 100644 (file)
index 0000000..526b529
Binary files /dev/null and b/utils/test/reporting/img/icon-nok.png differ
diff --git a/utils/test/reporting/img/icon-ok.png b/utils/test/reporting/img/icon-ok.png
new file mode 100644 (file)
index 0000000..3a9de2e
Binary files /dev/null and b/utils/test/reporting/img/icon-ok.png differ
diff --git a/utils/test/reporting/img/weather-clear.png b/utils/test/reporting/img/weather-clear.png
new file mode 100644 (file)
index 0000000..a0d9677
Binary files /dev/null and b/utils/test/reporting/img/weather-clear.png differ
diff --git a/utils/test/reporting/img/weather-few-clouds.png b/utils/test/reporting/img/weather-few-clouds.png
new file mode 100644 (file)
index 0000000..acfa783
Binary files /dev/null and b/utils/test/reporting/img/weather-few-clouds.png differ
diff --git a/utils/test/reporting/img/weather-overcast.png b/utils/test/reporting/img/weather-overcast.png
new file mode 100644 (file)
index 0000000..4296246
Binary files /dev/null and b/utils/test/reporting/img/weather-overcast.png differ
diff --git a/utils/test/reporting/img/weather-storm.png b/utils/test/reporting/img/weather-storm.png
new file mode 100644 (file)
index 0000000..956f0e2
Binary files /dev/null and b/utils/test/reporting/img/weather-storm.png differ
diff --git a/utils/test/reporting/reporting.yaml b/utils/test/reporting/reporting.yaml
new file mode 100644 (file)
index 0000000..447d6e1
--- /dev/null
@@ -0,0 +1,49 @@
+general:
+    installers:
+        - apex
+        - compass
+        - fuel
+        - joid
+
+    versions:
+        - master
+        - colorado
+    log:
+        log_file: reporting.log
+        log_level: ERROR
+
+    period: 10
+
+    nb_iteration_tests_success_criteria: 4
+
+    directories:
+        # Relative to the path where the repo is cloned:
+        dir_reporting:    utils/tests/reporting/
+        dir_log:          utils/tests/reporting/log/
+        dir_conf:         utils/tests/reporting/conf/
+        dir_utils:        utils/tests/reporting/utils/
+        dir_templates:    utils/tests/reporting/templates/
+        dir_display:      utils/tests/reporting/display/
+
+    url: testresults.opnfv.org/reporting/
+
+testapi:
+    url: testresults.opnfv.org/test/api/v1/results
+    
+functest:
+    blacklist:
+        - ovno
+        - security_scan
+    max_scenario_criteria: 50
+    test_conf: https://git.opnfv.org/cgit/functest/plain/functest/ci/testcases.yaml
+    log_level: ERROR
+    jenkins_url: https://build.opnfv.org/ci/view/functest/job
+    
+    
+yardstick:
+    test_conf: https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml
+    log_level: ERROR
+
+qtip:
+
+bottleneck:
diff --git a/utils/test/reporting/run_unit_tests.sh b/utils/test/reporting/run_unit_tests.sh
new file mode 100755 (executable)
index 0000000..6b0e3b2
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+set -o errexit
+set -o pipefail
+
+# ******************************
+# prepare the env for the tests
+# ******************************
+# Either Workspace is set (CI)
+if [ -z $WORKSPACE ]
+then
+    WORKSPACE="."
+fi
+
+export CONFIG_REPORTING_YAML=./reporting.yaml
+
+# ***************
+# Run unit tests
+# ***************
+echo "Running unit tests..."
+
+# start vitual env
+virtualenv $WORKSPACE/reporting_venv
+source $WORKSPACE/reporting_venv/bin/activate
+
+# install python packages
+easy_install -U setuptools
+easy_install -U pip
+pip install -r $WORKSPACE/docker/requirements.pip
+pip install -e $WORKSPACE
+
+python $WORKSPACE/setup.py develop
+
+# unit tests
+# TODO: remove cover-erase
+# To be deleted when all functest packages will be listed
+nosetests --with-xunit \
+         --cover-package=utils \
+         --with-coverage \
+         --cover-xml \
+         tests/unit
+rc=$?
+
+deactivate
diff --git a/utils/test/reporting/setup.py b/utils/test/reporting/setup.py
new file mode 100644 (file)
index 0000000..627785e
--- /dev/null
@@ -0,0 +1,22 @@
+##############################################################################
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+from setuptools import setup, find_packages
+
+
+setup(
+    name="reporting",
+    version="master",
+    packages=find_packages(),
+    include_package_data=True,
+    package_data={
+    },
+    url="https://www.opnfv.org",
+    install_requires=["coverage==4.1",
+                      "mock==1.3.0",
+                      "nose==1.3.7"],
+)
diff --git a/utils/test/reporting/tests/__init__.py b/utils/test/reporting/tests/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/utils/test/reporting/tests/unit/__init__.py b/utils/test/reporting/tests/unit/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/utils/test/reporting/tests/unit/utils/__init__.py b/utils/test/reporting/tests/unit/utils/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/utils/test/reporting/tests/unit/utils/test_utils.py b/utils/test/reporting/tests/unit/utils/test_utils.py
new file mode 100644 (file)
index 0000000..b9c3980
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2016 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+
+import logging
+import unittest
+
+from utils import reporting_utils
+
+
+class reportingUtilsTesting(unittest.TestCase):
+
+    logging.disable(logging.CRITICAL)
+
+    def setUp(self):
+        self.test = reporting_utils
+
+    def test_getConfig(self):
+        self.assertEqual(self.test.get_config("general.period"), 10)
+# TODO
+# ...
+
+if __name__ == "__main__":
+    unittest.main(verbosity=2)
diff --git a/utils/test/reporting/utils/__init__.py b/utils/test/reporting/utils/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/utils/test/reporting/utils/reporting_utils.py b/utils/test/reporting/utils/reporting_utils.py
new file mode 100644 (file)
index 0000000..0af60c7
--- /dev/null
@@ -0,0 +1,355 @@
+#!/usr/bin/python
+#
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+from urllib2 import Request, urlopen, URLError
+import logging
+import json
+import os
+import pdfkit
+import yaml
+
+
+# ----------------------------------------------------------
+#
+#               YAML UTILS
+#
+# -----------------------------------------------------------
+def get_parameter_from_yaml(parameter, file):
+    """
+    Returns the value of a given parameter in file.yaml
+    parameter must be given in string format with dots
+    Example: general.openstack.image_name
+    """
+    with open(file) as f:
+        file_yaml = yaml.safe_load(f)
+    f.close()
+    value = file_yaml
+    for element in parameter.split("."):
+        value = value.get(element)
+        if value is None:
+            raise ValueError("The parameter %s is not defined in"
+                             " reporting.yaml" % parameter)
+    return value
+
+
+def get_config(parameter):
+    yaml_ = os.environ["CONFIG_REPORTING_YAML"]
+    return get_parameter_from_yaml(parameter, yaml_)
+
+
+# ----------------------------------------------------------
+#
+#               LOGGER UTILS
+#
+# -----------------------------------------------------------
+def getLogger(module):
+    logFormatter = logging.Formatter("%(asctime)s [" +
+                                     module +
+                                     "] [%(levelname)-5.5s]  %(message)s")
+    logger = logging.getLogger()
+    log_file = get_config('general.log.log_file')
+    log_level = get_config('general.log.log_level')
+
+    fileHandler = logging.FileHandler("{0}/{1}".format('.', log_file))
+    fileHandler.setFormatter(logFormatter)
+    logger.addHandler(fileHandler)
+
+    consoleHandler = logging.StreamHandler()
+    consoleHandler.setFormatter(logFormatter)
+    logger.addHandler(consoleHandler)
+    logger.setLevel(log_level)
+    return logger
+
+
+# ----------------------------------------------------------
+#
+#               REPORTING UTILS
+#
+# -----------------------------------------------------------
+def getApiResults(case, installer, scenario, version):
+    results = json.dumps([])
+    # to remove proxy (to be removed at the end for local test only)
+    # proxy_handler = urllib2.ProxyHandler({})
+    # opener = urllib2.build_opener(proxy_handler)
+    # urllib2.install_opener(opener)
+    # url = "http://127.0.0.1:8000/results?case=" + case + \
+    #       "&period=30&installer=" + installer
+    period = get_config('general.period')
+    url_base = get_config('testapi.url')
+    nb_tests = get_config('general.nb_iteration_tests_success_criteria')
+
+    url = ("http://" + url_base + "?case=" + case +
+           "&period=" + str(period) + "&installer=" + installer +
+           "&scenario=" + scenario + "&version=" + version +
+           "&last=" + str(nb_tests))
+    request = Request(url)
+
+    try:
+        response = urlopen(request)
+        k = response.read()
+        results = json.loads(k)
+    except URLError, e:
+        print 'No kittez. Got an error code:', e
+
+    return results
+
+
+def getScenarios(case, installer, version):
+
+    case = case.getName()
+    period = get_config('general.period')
+    url_base = get_config('testapi.url')
+
+    url = ("http://" + url_base + "?case=" + case +
+           "&period=" + str(period) + "&installer=" + installer +
+           "&version=" + version)
+    request = Request(url)
+
+    try:
+        response = urlopen(request)
+        k = response.read()
+        results = json.loads(k)
+        test_results = results['results']
+    except URLError, e:
+        print 'Got an error code:', e
+
+    if test_results is not None:
+        test_results.reverse()
+
+        scenario_results = {}
+
+        for r in test_results:
+            # Retrieve all the scenarios per installer
+            if not r['scenario'] in scenario_results.keys():
+                scenario_results[r['scenario']] = []
+            scenario_results[r['scenario']].append(r)
+
+    return scenario_results
+
+
+def getScenarioStats(scenario_results):
+    scenario_stats = {}
+    for k, v in scenario_results.iteritems():
+        scenario_stats[k] = len(v)
+
+    return scenario_stats
+
+
+# TODO convergence with above function getScenarios
+def getScenarioStatus(installer, version):
+    period = get_config('general.period')
+    url_base = get_config('testapi.url')
+
+    url = ("http://" + url_base + "?case=scenario_status" +
+           "&installer=" + installer +
+           "&version=" + version + "&period=" + str(period))
+    request = Request(url)
+
+    try:
+        response = urlopen(request)
+        k = response.read()
+        response.close()
+        results = json.loads(k)
+        test_results = results['results']
+    except URLError, e:
+        print 'Got an error code:', e
+
+    scenario_results = {}
+    result_dict = {}
+    if test_results is not None:
+        for r in test_results:
+            if r['stop_date'] != 'None' and r['criteria'] is not None:
+                if not r['scenario'] in scenario_results.keys():
+                    scenario_results[r['scenario']] = []
+                scenario_results[r['scenario']].append(r)
+
+        for k, v in scenario_results.items():
+            # scenario_results[k] = v[:LASTEST_TESTS]
+            s_list = []
+            for element in v:
+                if element['criteria'] == 'SUCCESS':
+                    s_list.append(1)
+                else:
+                    s_list.append(0)
+            result_dict[k] = s_list
+
+    # return scenario_results
+    return result_dict
+
+
+def getNbtestOk(results):
+    nb_test_ok = 0
+    for r in results:
+        for k, v in r.iteritems():
+            try:
+                if "PASS" in v:
+                    nb_test_ok += 1
+            except:
+                print "Cannot retrieve test status"
+    return nb_test_ok
+
+
+def getResult(testCase, installer, scenario, version):
+
+    # retrieve raw results
+    results = getApiResults(testCase, installer, scenario, version)
+    # let's concentrate on test results only
+    test_results = results['results']
+
+    # if results found, analyze them
+    if test_results is not None:
+        test_results.reverse()
+
+        scenario_results = []
+
+        # print " ---------------- "
+        # print test_results
+        # print " ---------------- "
+        # print "nb of results:" + str(len(test_results))
+
+        for r in test_results:
+            # print r["start_date"]
+            # print r["criteria"]
+            scenario_results.append({r["start_date"]: r["criteria"]})
+        # sort results
+        scenario_results.sort()
+        # 4 levels for the results
+        # 3: 4+ consecutive runs passing the success criteria
+        # 2: <4 successful consecutive runs but passing the criteria
+        # 1: close to pass the success criteria
+        # 0: 0% success, not passing
+        # -1: no run available
+        test_result_indicator = 0
+        nbTestOk = getNbtestOk(scenario_results)
+
+        # print "Nb test OK (last 10 days):"+ str(nbTestOk)
+        # check that we have at least 4 runs
+        if len(scenario_results) < 1:
+            # No results available
+            test_result_indicator = -1
+        elif nbTestOk < 1:
+            test_result_indicator = 0
+        elif nbTestOk < 2:
+            test_result_indicator = 1
+        else:
+            # Test the last 4 run
+            if (len(scenario_results) > 3):
+                last4runResults = scenario_results[-4:]
+                nbTestOkLast4 = getNbtestOk(last4runResults)
+                # print "Nb test OK (last 4 run):"+ str(nbTestOkLast4)
+                if nbTestOkLast4 > 3:
+                    test_result_indicator = 3
+                else:
+                    test_result_indicator = 2
+            else:
+                test_result_indicator = 2
+    return test_result_indicator
+
+
+def getJenkinsUrl(build_tag):
+    # e.g. jenkins-functest-apex-apex-daily-colorado-daily-colorado-246
+    # id = 246
+    # note it is linked to jenkins format
+    # if this format changes...function to be adapted....
+    url_base = get_config('functest.jenkins_url')
+    try:
+        build_id = [int(s) for s in build_tag.split("-") if s.isdigit()]
+        jenkins_path = filter(lambda c: not c.isdigit(), build_tag)
+        url_id = jenkins_path[8:-1] + "/" + str(build_id[0])
+        jenkins_url = url_base + url_id + "/console"
+    except:
+        print 'Impossible to get jenkins url:'
+
+    return jenkins_url
+
+
+def getScenarioPercent(scenario_score, scenario_criteria):
+    score = 0.0
+    try:
+        score = float(scenario_score) / float(scenario_criteria) * 100
+    except:
+        print 'Impossible to calculate the percentage score'
+    return score
+
+
+# *********
+# Yardstick
+# *********
+def subfind(given_list, pattern_list):
+    LASTEST_TESTS = get_config('general.nb_iteration_tests_success_criteria')
+    for i in range(len(given_list)):
+        if given_list[i] == pattern_list[0] and \
+                given_list[i:i + LASTEST_TESTS] == pattern_list:
+            return True
+    return False
+
+
+def _get_percent(status):
+
+    if status * 100 % 6:
+        return round(float(status) * 100 / 6, 1)
+    else:
+        return status * 100 / 6
+
+
+def get_percent(four_list, ten_list):
+    four_score = 0
+    ten_score = 0
+
+    for v in four_list:
+        four_score += v
+    for v in ten_list:
+        ten_score += v
+
+    LASTEST_TESTS = get_config('general.nb_iteration_tests_success_criteria')
+    if four_score == LASTEST_TESTS:
+        status = 6
+    elif subfind(ten_list, [1, 1, 1, 1]):
+        status = 5
+    elif ten_score == 0:
+        status = 0
+    else:
+        status = four_score + 1
+
+    return _get_percent(status)
+
+
+def _test():
+    status = getScenarioStatus("compass", "master")
+    print "status:++++++++++++++++++++++++"
+    print json.dumps(status, indent=4)
+
+
+# ----------------------------------------------------------
+#
+#               Export
+#
+# -----------------------------------------------------------
+
+def export_csv(scenario_file_name, installer, version):
+    # csv
+    # generate sub files based on scenario_history.txt
+    scenario_installer_file_name = ("./display/" + version +
+                                    "/functest/scenario_history_" +
+                                    installer + ".csv")
+    scenario_installer_file = open(scenario_installer_file_name, "a")
+    with open(scenario_file_name, "r") as f:
+        scenario_installer_file.write("date,scenario,installer,detail,score\n")
+        for line in f:
+            if installer in line:
+                scenario_installer_file.write(line)
+        scenario_installer_file.close
+
+
+def export_pdf(pdf_path, pdf_doc_name):
+    try:
+        pdfkit.from_file(pdf_path, pdf_doc_name)
+    except IOError:
+        print("Error but pdf generated anyway...")
+    except:
+        print("impossible to generate PDF")
index 49809e9..3381549 100644 (file)
@@ -10,31 +10,36 @@ import datetime
 import jinja2
 import os
 
-import reportingUtils as utils
-import reportingConf as conf
 import scenarioResult as sr
 from scenarios import config as cf
 
+# manage conf
+import utils.reporting_utils as rp_utils
+
+installers = rp_utils.get_config('general.installers')
+versions = rp_utils.get_config('general.versions')
+PERIOD = rp_utils.get_config('general.period')
+
 # Logger
-logger = utils.getLogger("Yardstick-Status")
+logger = rp_utils.getLogger("Yardstick-Status")
 reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
 
 logger.info("*******************************************")
 logger.info("*   Generating reporting scenario status  *")
-logger.info("*   Data retention = %s days              *" % conf.PERIOD)
+logger.info("*   Data retention = %s days              *" % PERIOD)
 logger.info("*                                         *")
 logger.info("*******************************************")
 
 
 # For all the versions
-for version in conf.versions:
+for version in versions:
     # For all the installers
-    for installer in conf.installers:
+    for installer in installers:
         # get scenarios results data
-        scenario_results = utils.getScenarioStatus(installer, version)
+        scenario_results = rp_utils.getScenarioStatus(installer, version)
         if 'colorado' == version:
-            stable_result = utils.getScenarioStatus(installer,
-                                                    'stable/colorado')
+            stable_result = rp_utils.getScenarioStatus(installer,
+                                                       'stable/colorado')
             for k, v in stable_result.items():
                 if k not in scenario_results.keys():
                     scenario_results[k] = []
@@ -48,24 +53,25 @@ for version in conf.versions:
         # From each scenarios get results list
         for s, s_result in scenario_results.items():
             logger.info("---------------------------------")
-            logger.info("installer %s, version %s, scenario %s:" % (installer,
-                                                                    version, s))
+            logger.info("installer %s, version %s, " +
+                        "scenario %s:" % (installer, version, s))
 
             ten_criteria = len(s_result)
             ten_score = 0
             for v in s_result:
                 ten_score += v
 
-            four_result = s_result[:conf.LASTEST_TESTS]
+            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:
                 four_score += v
 
-            s_status = str(utils.get_percent(four_result, s_result))
+            s_status = str(rp_utils.get_percent(four_result, s_result))
             s_four_score = str(four_score) + '/' + str(four_criteria)
             s_ten_score = str(ten_score) + '/' + str(ten_criteria)
-            s_score_percent = utils.get_percent(four_result, s_result)
+            s_score_percent = rp_utils.get_percent(four_result, s_result)
 
             if '100' == s_status:
                 logger.info(">>>>> scenario OK, save the information")
@@ -74,9 +80,8 @@ for version in conf.versions:
                             last 10 days = %s" % (s_four_score, s_ten_score))
 
             # Save daily results in a file
-            path_validation_file = (conf.REPORTING_PATH +
-                                    "/release/" + version +
-                                    "/scenario_history.txt")
+            path_validation_file = ("./display/" + version +
+                                    "/yardstick/scenario_history.txt")
 
             if not os.path.exists(path_validation_file):
                 with open(path_validation_file, 'w') as f:
@@ -96,18 +101,19 @@ for version in conf.versions:
 
             logger.info("--------------------------")
 
-        templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH)
-        templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True)
+        templateLoader = jinja2.FileSystemLoader(".")
+        templateEnv = jinja2.Environment(loader=templateLoader,
+                                         autoescape=True)
 
-        TEMPLATE_FILE = "/template/index-status-tmpl.html"
+        TEMPLATE_FILE = "./yardstick/template/index-status-tmpl.html"
         template = templateEnv.get_template(TEMPLATE_FILE)
 
         outputText = template.render(scenario_results=scenario_result_criteria,
                                      installer=installer,
-                                     period=conf.PERIOD,
+                                     period=PERIOD,
                                      version=version,
                                      date=reportingDate)
 
-        with open(conf.REPORTING_PATH + "/release/" + version +
-                  "/index-status-" + installer + ".html", "wb") as fh:
+        with open("./display/" + version +
+                  "/yardstick/status-" + installer + ".html", "wb") as fh:
             fh.write(outputText)
diff --git a/utils/test/reporting/yardstick/reportingConf.py b/utils/test/reporting/yardstick/reportingConf.py
deleted file mode 100644 (file)
index 2db41f0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-#
-# This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Reporting: Declaration of the variables
-#
-# ****************************************************
-installers = ["apex", "compass", "fuel", "joid"]
-
-versions = ["master", "colorado"]
-
-# get data in the past 10 days
-PERIOD = 10
-
-# get the lastest 4 test results to determinate the success criteria
-LASTEST_TESTS = 4
-
-REPORTING_PATH = "."
-
-URL_BASE = 'http://testresults.opnfv.org/test/api/v1/results'
-TEST_CONF = "https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml"
-
-# LOG_LEVEL = "ERROR"
-LOG_LEVEL = "INFO"
-LOG_FILE = REPORTING_PATH + "/reporting.log"
diff --git a/utils/test/reporting/yardstick/reportingUtils.py b/utils/test/reporting/yardstick/reportingUtils.py
deleted file mode 100644 (file)
index ec9ed76..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/python
-#
-# This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-from urllib2 import Request, urlopen, URLError
-import logging
-import json
-import reportingConf as conf
-
-
-def getLogger(module):
-    logFormatter = logging.Formatter("%(asctime)s [" +
-                                     module +
-                                     "] [%(levelname)-5.5s]  %(message)s")
-    logger = logging.getLogger()
-
-    fileHandler = logging.FileHandler("{0}/{1}".format('.', conf.LOG_FILE))
-    fileHandler.setFormatter(logFormatter)
-    logger.addHandler(fileHandler)
-
-    consoleHandler = logging.StreamHandler()
-    consoleHandler.setFormatter(logFormatter)
-    logger.addHandler(consoleHandler)
-    logger.setLevel(conf.LOG_LEVEL)
-    return logger
-
-
-def getScenarioStatus(installer, version):
-    url = (conf.URL_BASE + "?case=" + "scenario_status" +
-           "&installer=" + installer +
-           "&version=" + version + "&period=" + str(conf.PERIOD))
-    request = Request(url)
-
-    try:
-        response = urlopen(request)
-        k = response.read()
-        response.close()
-        results = json.loads(k)
-        test_results = results['results']
-    except URLError, e:
-        print 'Got an error code:', e
-
-    scenario_results = {}
-    result_dict = {}
-    if test_results is not None:
-        for r in test_results:
-            if r['stop_date'] != 'None' and r['criteria'] is not None:
-                if not r['scenario'] in scenario_results.keys():
-                    scenario_results[r['scenario']] = []
-                scenario_results[r['scenario']].append(r)
-
-        for k, v in scenario_results.items():
-            # scenario_results[k] = v[:conf.LASTEST_TESTS]
-            s_list = []
-            for element in v:
-                if element['criteria'] == 'SUCCESS':
-                    s_list.append(1)
-                else:
-                    s_list.append(0)
-            result_dict[k] = s_list
-
-    # return scenario_results
-    return result_dict
-
-
-def subfind(given_list, pattern_list):
-
-    for i in range(len(given_list)):
-        if given_list[i] == pattern_list[0] and \
-                given_list[i:i + conf.LASTEST_TESTS] == pattern_list:
-            return True
-    return False
-
-
-def _get_percent(status):
-
-    if status * 100 % 6:
-        return round(float(status) * 100 / 6, 1)
-    else:
-        return status * 100 / 6
-
-
-def get_percent(four_list, ten_list):
-    four_score = 0
-    ten_score = 0
-
-    for v in four_list:
-        four_score += v
-    for v in ten_list:
-        ten_score += v
-
-    if four_score == conf.LASTEST_TESTS:
-        status = 6
-    elif subfind(ten_list, [1, 1, 1, 1]):
-        status = 5
-    elif ten_score == 0:
-        status = 0
-    else:
-        status = four_score + 1
-
-    return _get_percent(status)
-
-
-def _test():
-    status = getScenarioStatus("compass", "master")
-    print "status:++++++++++++++++++++++++"
-    print json.dumps(status, indent=4)
-
-
-if __name__ == '__main__':    # pragma: no cover
-    _test()
index 590fea2..26e8c8b 100644 (file)
@@ -1,11 +1,18 @@
-import yaml
-import os
+#!/usr/bin/python
+#
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
 import requests
+import yaml
 
-import reportingConf as conf
-
+import utils.reporting_utils as rp_utils
 
-response = requests.get(conf.TEST_CONF)
+yardstick_conf = rp_utils.get_config('yardstick.test_conf')
+response = requests.get(yardstick_conf)
 yaml_file = yaml.safe_load(response.text)
 reporting = yaml_file.get('reporting')
 
@@ -15,6 +22,6 @@ for element in reporting:
     name = element['name']
     scenarios = element['scenario']
     for s in scenarios:
-        if not config.has_key(name):
+        if name not in config:
             config[name] = {}
         config[name][s] = True
index 5a4dc34..b6f237a 100644 (file)
@@ -3,12 +3,12 @@
     <meta charset="utf-8">
     <!-- Bootstrap core CSS -->
     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
-    <link href="../../../css/default.css" rel="stylesheet">
+    <link href="../../css/default.css" rel="stylesheet">
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
     <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
     <script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
-    <script type="text/javascript" src="../../../js/gauge.js"></script>
-    <script type="text/javascript" src="../../../js/trend.js"></script>
+    <script type="text/javascript" src="../../js/gauge.js"></script>
+    <script type="text/javascript" src="../../js/trend.js"></script>
     <script>
         function onDocumentReady() {
             // Gauge management
@@ -25,8 +25,7 @@
         }
 
         // trend line management
-        //d3.csv("./scenario_history.txt", function(data) {
-        d3.csv("./scenario_history.txt", function(data) {
+        d3.csv("./scenario_history.csv", function(data) {
             // ***************************************
             // Create the trend line
             {% for scenario in scenario_results.keys() -%}