summaryrefslogtreecommitdiffstats
path: root/reporting
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-07-04 17:23:33 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2017-08-09 16:45:43 +0200
commit980523c1c5fa65b4c4a786d6ddb1ddfb70a63bc6 (patch)
tree68072820e868a4688036c2425195966167fdd8fb /reporting
parent5eb90d88748ee25c0d1a858167d435a9498d175c (diff)
Initiate packetization of Testing reporting
Testing reporting provides - static reporting pages [1] (jinja2) - landing pages including test case catalogue [2] (angular) It consumes the Test API to build web pages providing status for the testing projects (so far functest, yardstick, storperf and qtip). Dockerization has been initiated [3]. The goal is to replace the static page hosted on testresults.opnfv.org by a docker regenerated and redeployed when reporting code is changed But the docker and more generally the testing reporting directory must be refactored to - manage dependencies properly - leverage tox (py27, docs, pylint, pep8) This patch - setups tox (py27, pep8, pylint, docs) - integrate the requirement management - fix pep8 errors - introduce 1 dummy unit test This patch does not - fix pylint errors - create any doc [1]: http://testresults.opnfv.org/reporting2/display/index.html [2]: http://testresults.opnfv.org/reporting2/reporting/index.html [3]: https://gerrit.opnfv.org/gerrit/#/c/36735/ Change-Id: I4613de7ca7036d6c6bbb8f58ade492b1d673599b Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'reporting')
-rw-r--r--reporting/api/__init__.py (renamed from reporting/api/api/__init__.py)0
-rw-r--r--reporting/api/conf.py (renamed from reporting/api/api/conf.py)0
-rw-r--r--reporting/api/handlers/__init__.py (renamed from reporting/api/api/handlers/__init__.py)0
-rw-r--r--reporting/api/handlers/landing.py (renamed from reporting/api/api/handlers/landing.py)0
-rw-r--r--reporting/api/handlers/projects.py (renamed from reporting/api/api/handlers/projects.py)0
-rw-r--r--reporting/api/handlers/testcases.py (renamed from reporting/api/api/handlers/testcases.py)0
-rw-r--r--reporting/api/requirements.txt3
-rw-r--r--reporting/api/server.py (renamed from reporting/api/api/server.py)0
-rw-r--r--reporting/api/setup.cfg32
-rw-r--r--reporting/api/setup.py9
-rw-r--r--reporting/api/urls.py (renamed from reporting/api/api/urls.py)0
-rw-r--r--reporting/docker/Dockerfile20
-rw-r--r--reporting/docker/nginx.conf4
-rwxr-xr-xreporting/docker/reporting.sh70
-rw-r--r--reporting/docker/supervisor.conf4
-rwxr-xr-xreporting/docker/web_server.sh16
-rw-r--r--reporting/docs/_build/.buildinfo4
-rw-r--r--reporting/docs/_build/.doctrees/environment.picklebin0 -> 4207 bytes
-rw-r--r--reporting/docs/_build/.doctrees/index.doctreebin0 -> 4892 bytes
-rw-r--r--reporting/docs/conf.py341
-rw-r--r--reporting/docs/index.rst16
-rw-r--r--reporting/reporting/__init__.py (renamed from reporting/functest/__init__.py)0
-rw-r--r--reporting/reporting/functest/__init__.py (renamed from reporting/qtip/__init__.py)0
-rw-r--r--reporting/reporting/functest/img/gauge_0.png (renamed from reporting/functest/img/gauge_0.png)bin3644 -> 3644 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_100.png (renamed from reporting/functest/img/gauge_100.png)bin3191 -> 3191 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_16.7.png (renamed from reporting/functest/img/gauge_16.7.png)bin3170 -> 3170 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_25.png (renamed from reporting/functest/img/gauge_25.png)bin3108 -> 3108 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_33.3.png (renamed from reporting/functest/img/gauge_33.3.png)bin3081 -> 3081 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_41.7.png (renamed from reporting/functest/img/gauge_41.7.png)bin3169 -> 3169 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_50.png (renamed from reporting/functest/img/gauge_50.png)bin3123 -> 3123 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_58.3.png (renamed from reporting/functest/img/gauge_58.3.png)bin3161 -> 3161 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_66.7.png (renamed from reporting/functest/img/gauge_66.7.png)bin3069 -> 3069 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_75.png (renamed from reporting/functest/img/gauge_75.png)bin3030 -> 3030 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_8.3.png (renamed from reporting/functest/img/gauge_8.3.png)bin2993 -> 2993 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_83.3.png (renamed from reporting/functest/img/gauge_83.3.png)bin3122 -> 3122 bytes
-rw-r--r--reporting/reporting/functest/img/gauge_91.7.png (renamed from reporting/functest/img/gauge_91.7.png)bin3008 -> 3008 bytes
-rw-r--r--reporting/reporting/functest/img/icon-nok.png (renamed from reporting/functest/img/icon-nok.png)bin2317 -> 2317 bytes
-rw-r--r--reporting/reporting/functest/img/icon-ok.png (renamed from reporting/functest/img/icon-ok.png)bin4063 -> 4063 bytes
-rw-r--r--reporting/reporting/functest/img/weather-clear.png (renamed from reporting/functest/img/weather-clear.png)bin1560 -> 1560 bytes
-rw-r--r--reporting/reporting/functest/img/weather-few-clouds.png (renamed from reporting/functest/img/weather-few-clouds.png)bin1927 -> 1927 bytes
-rw-r--r--reporting/reporting/functest/img/weather-overcast.png (renamed from reporting/functest/img/weather-overcast.png)bin1588 -> 1588 bytes
-rw-r--r--reporting/reporting/functest/img/weather-storm.png (renamed from reporting/functest/img/weather-storm.png)bin2137 -> 2137 bytes
-rw-r--r--reporting/reporting/functest/index.html (renamed from reporting/functest/index.html)0
-rwxr-xr-xreporting/reporting/functest/reporting-status.py (renamed from reporting/functest/reporting-status.py)5
-rwxr-xr-xreporting/reporting/functest/reporting-tempest.py (renamed from reporting/functest/reporting-tempest.py)2
-rwxr-xr-xreporting/reporting/functest/reporting-vims.py (renamed from reporting/functest/reporting-vims.py)4
-rw-r--r--reporting/reporting/functest/scenarioResult.py (renamed from reporting/functest/scenarioResult.py)0
-rw-r--r--reporting/reporting/functest/template/index-status-tmpl.html (renamed from reporting/functest/template/index-status-tmpl.html)0
-rw-r--r--reporting/reporting/functest/template/index-tempest-tmpl.html (renamed from reporting/functest/template/index-tempest-tmpl.html)0
-rw-r--r--reporting/reporting/functest/template/index-vims-tmpl.html (renamed from reporting/functest/template/index-vims-tmpl.html)0
-rw-r--r--reporting/reporting/functest/testCase.py (renamed from reporting/functest/testCase.py)0
-rw-r--r--reporting/reporting/qtip/__init__.py (renamed from reporting/tests/__init__.py)0
-rw-r--r--reporting/reporting/qtip/index.html (renamed from reporting/qtip/index.html)0
-rw-r--r--reporting/reporting/qtip/reporting-status.py (renamed from reporting/qtip/reporting-status.py)8
-rw-r--r--reporting/reporting/qtip/template/index-status-tmpl.html (renamed from reporting/qtip/template/index-status-tmpl.html)0
-rw-r--r--reporting/reporting/reporting.yaml (renamed from reporting/reporting.yaml)0
-rw-r--r--reporting/reporting/storperf/__init__.py (renamed from reporting/tests/unit/__init__.py)0
-rw-r--r--reporting/reporting/storperf/reporting-status.py (renamed from reporting/storperf/reporting-status.py)2
-rw-r--r--reporting/reporting/storperf/template/index-status-tmpl.html (renamed from reporting/storperf/template/index-status-tmpl.html)0
-rw-r--r--reporting/reporting/tests/__init__.py (renamed from reporting/tests/unit/utils/__init__.py)0
-rw-r--r--reporting/reporting/tests/unit/__init__.py (renamed from reporting/utils/__init__.py)0
-rw-r--r--reporting/reporting/tests/unit/utils/__init__.py0
-rw-r--r--reporting/reporting/tests/unit/utils/test_utils.py (renamed from reporting/tests/unit/utils/test_utils.py)9
-rw-r--r--reporting/reporting/utils/__init__.py0
-rw-r--r--reporting/reporting/utils/reporting_utils.py (renamed from reporting/utils/reporting_utils.py)46
-rw-r--r--reporting/reporting/utils/scenarioResult.py (renamed from reporting/utils/scenarioResult.py)0
-rw-r--r--reporting/reporting/yardstick/__init__.py0
-rw-r--r--reporting/reporting/yardstick/img/gauge_0.png (renamed from reporting/yardstick/img/gauge_0.png)bin3644 -> 3644 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_100.png (renamed from reporting/yardstick/img/gauge_100.png)bin3191 -> 3191 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_16.7.png (renamed from reporting/yardstick/img/gauge_16.7.png)bin3170 -> 3170 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_25.png (renamed from reporting/yardstick/img/gauge_25.png)bin3108 -> 3108 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_33.3.png (renamed from reporting/yardstick/img/gauge_33.3.png)bin3081 -> 3081 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_41.7.png (renamed from reporting/yardstick/img/gauge_41.7.png)bin3169 -> 3169 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_50.png (renamed from reporting/yardstick/img/gauge_50.png)bin3123 -> 3123 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_58.3.png (renamed from reporting/yardstick/img/gauge_58.3.png)bin3161 -> 3161 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_66.7.png (renamed from reporting/yardstick/img/gauge_66.7.png)bin3069 -> 3069 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_75.png (renamed from reporting/yardstick/img/gauge_75.png)bin3030 -> 3030 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_8.3.png (renamed from reporting/yardstick/img/gauge_8.3.png)bin2993 -> 2993 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_83.3.png (renamed from reporting/yardstick/img/gauge_83.3.png)bin3122 -> 3122 bytes
-rw-r--r--reporting/reporting/yardstick/img/gauge_91.7.png (renamed from reporting/yardstick/img/gauge_91.7.png)bin3008 -> 3008 bytes
-rw-r--r--reporting/reporting/yardstick/img/icon-nok.png (renamed from reporting/yardstick/img/icon-nok.png)bin2317 -> 2317 bytes
-rw-r--r--reporting/reporting/yardstick/img/icon-ok.png (renamed from reporting/yardstick/img/icon-ok.png)bin4063 -> 4063 bytes
-rw-r--r--reporting/reporting/yardstick/img/weather-clear.png (renamed from reporting/yardstick/img/weather-clear.png)bin1560 -> 1560 bytes
-rw-r--r--reporting/reporting/yardstick/img/weather-few-clouds.png (renamed from reporting/yardstick/img/weather-few-clouds.png)bin1927 -> 1927 bytes
-rw-r--r--reporting/reporting/yardstick/img/weather-overcast.png (renamed from reporting/yardstick/img/weather-overcast.png)bin1588 -> 1588 bytes
-rw-r--r--reporting/reporting/yardstick/img/weather-storm.png (renamed from reporting/yardstick/img/weather-storm.png)bin2137 -> 2137 bytes
-rw-r--r--reporting/reporting/yardstick/index.html (renamed from reporting/yardstick/index.html)0
-rw-r--r--reporting/reporting/yardstick/reporting-status.py (renamed from reporting/yardstick/reporting-status.py)2
-rw-r--r--reporting/reporting/yardstick/scenarios.py (renamed from reporting/yardstick/scenarios.py)0
-rw-r--r--reporting/reporting/yardstick/template/index-status-tmpl.html (renamed from reporting/yardstick/template/index-status-tmpl.html)0
-rw-r--r--reporting/requirements.txt7
-rwxr-xr-xreporting/run_test.sh45
-rw-r--r--reporting/setup.cfg12
-rw-r--r--reporting/setup.py32
-rw-r--r--reporting/test-requirements.txt5
-rw-r--r--reporting/tox.ini27
96 files changed, 524 insertions, 201 deletions
diff --git a/reporting/api/api/__init__.py b/reporting/api/__init__.py
index e69de29..e69de29 100644
--- a/reporting/api/api/__init__.py
+++ b/reporting/api/__init__.py
diff --git a/reporting/api/api/conf.py b/reporting/api/conf.py
index 5897d4f..5897d4f 100644
--- a/reporting/api/api/conf.py
+++ b/reporting/api/conf.py
diff --git a/reporting/api/api/handlers/__init__.py b/reporting/api/handlers/__init__.py
index bcda664..bcda664 100644
--- a/reporting/api/api/handlers/__init__.py
+++ b/reporting/api/handlers/__init__.py
diff --git a/reporting/api/api/handlers/landing.py b/reporting/api/handlers/landing.py
index 749916f..749916f 100644
--- a/reporting/api/api/handlers/landing.py
+++ b/reporting/api/handlers/landing.py
diff --git a/reporting/api/api/handlers/projects.py b/reporting/api/handlers/projects.py
index 02412cd..02412cd 100644
--- a/reporting/api/api/handlers/projects.py
+++ b/reporting/api/handlers/projects.py
diff --git a/reporting/api/api/handlers/testcases.py b/reporting/api/handlers/testcases.py
index 2b91186..2b91186 100644
--- a/reporting/api/api/handlers/testcases.py
+++ b/reporting/api/handlers/testcases.py
diff --git a/reporting/api/requirements.txt b/reporting/api/requirements.txt
deleted file mode 100644
index 12ad688..0000000
--- a/reporting/api/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-tornado==4.4.2
-requests==2.1.0
-
diff --git a/reporting/api/api/server.py b/reporting/api/server.py
index e340b01..e340b01 100644
--- a/reporting/api/api/server.py
+++ b/reporting/api/server.py
diff --git a/reporting/api/setup.cfg b/reporting/api/setup.cfg
deleted file mode 100644
index 53d1092..0000000
--- a/reporting/api/setup.cfg
+++ /dev/null
@@ -1,32 +0,0 @@
-[metadata]
-name = reporting
-
-author = JackChan
-author-email = chenjiankun1@huawei.com
-
-classifier =
- Environment :: opnfv
- Intended Audience :: Information Technology
- Intended Audience :: System Administrators
- License :: OSI Approved :: Apache Software License
- Operating System :: POSIX :: Linux
- Programming Language :: Python
- Programming Language :: Python :: 2
- Programming Language :: Python :: 2.7
-
-[global]
-setup-hooks =
- pbr.hooks.setup_hook
-
-[files]
-packages =
- api
-
-[entry_points]
-console_scripts =
- api = api.server:main
-
-[egg_info]
-tag_build =
-tag_date = 0
-tag_svn_revision = 0
diff --git a/reporting/api/setup.py b/reporting/api/setup.py
deleted file mode 100644
index d974816..0000000
--- a/reporting/api/setup.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import setuptools
-
-
-__author__ = 'JackChan'
-
-
-setuptools.setup(
- setup_requires=['pbr>=1.8'],
- pbr=True)
diff --git a/reporting/api/api/urls.py b/reporting/api/urls.py
index a5228b2..a5228b2 100644
--- a/reporting/api/api/urls.py
+++ b/reporting/api/urls.py
diff --git a/reporting/docker/Dockerfile b/reporting/docker/Dockerfile
index ad278ce..f5168d1 100644
--- a/reporting/docker/Dockerfile
+++ b/reporting/docker/Dockerfile
@@ -16,22 +16,20 @@
FROM nginx:stable
MAINTAINER Morgan Richomme <morgan.richomme@orange.com>
-LABEL version="danube.1.0" description="OPNFV Test Reporting Docker container"
+LABEL version="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
+ENV working_dir ${HOME}/releng/utils/test/reporting
+ENV CONFIG_REPORTING_YAML ${working_dir}/reporting.yaml
+WORKDIR ${HOME}
# Packaged dependencies
RUN apt-get update && apt-get install -y \
ssh \
python-pip \
git-core \
-wkhtmltopdf \
nodejs \
npm \
supervisor \
@@ -39,15 +37,13 @@ supervisor \
RUN pip install --upgrade pip
-RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng /home/opnfv
-RUN pip install -r ${working_dir}/docker/requirements.pip
-
-WORKDIR ${working_dir}/api
-RUN pip install -r requirements.txt
-RUN python setup.py install
+RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${HOME}/releng
+RUN pip install -r ${working_dir}/requirements.txt
WORKDIR ${working_dir}
+RUN python setup.py install
RUN docker/reporting.sh
+RUN docker/web_server.sh
expose 8000
diff --git a/reporting/docker/nginx.conf b/reporting/docker/nginx.conf
index 9e26972..ced8179 100644
--- a/reporting/docker/nginx.conf
+++ b/reporting/docker/nginx.conf
@@ -15,10 +15,10 @@ server {
}
location /reporting/ {
- alias /home/opnfv/utils/test/reporting/pages/dist/;
+ alias /home/opnfv/releng/utils/test/reporting/pages/dist/;
}
location /display/ {
- alias /home/opnfv/utils/test/reporting/display/;
+ alias /home/opnfv/releng/utils/test/reporting/display/;
}
}
diff --git a/reporting/docker/reporting.sh b/reporting/docker/reporting.sh
index 7fe97a8..076dc47 100755
--- a/reporting/docker/reporting.sh
+++ b/reporting/docker/reporting.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-export PYTHONPATH="${PYTHONPATH}:."
-export CONFIG_REPORTING_YAML=./reporting.yaml
+export PYTHONPATH="${PYTHONPATH}:./reporting"
+export CONFIG_REPORTING_YAML=./reporting/reporting.yaml
declare -a versions=(danube master)
-declare -a projects=(functest storperf yardstick)
+declare -a projects=(functest storperf yardstick qtip)
project=$1
reporting_type=$2
@@ -29,8 +29,9 @@ cp -Rf js display
# projet | option
# $1 | $2
# functest | status, vims, tempest
-# yardstick |
-# storperf |
+# yardstick | status
+# storperf | status
+# qtip | status
function report_project()
{
@@ -40,7 +41,7 @@ function report_project()
echo "********************************"
echo " $project reporting "
echo "********************************"
- python ./$dir/reporting-$type.py
+ python ./reporting/$dir/reporting-$type.py
if [ $? ]; then
echo "$project reporting $type...OK"
else
@@ -50,53 +51,28 @@ function report_project()
if [ -z "$1" ]; then
echo "********************************"
- echo " Functest reporting "
+ echo " * Static status 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"
+ for i in "${projects[@]}"
+ do
+ report_project $i $i "status"
+ sleep 5
+ done
+ report_project "QTIP" "qtip" "status"
- echo "********************************"
- echo " Storperf reporting "
- echo "********************************"
- python ./storperf/reporting-status.py
- echo "Storperf reporting status...OK"
- report_project "QTIP" "qtip" "status"
+ echo "Functest reporting vIMS..."
+ report_project "functest" "functest" "vims"
+ echo "reporting vIMS...OK"
+ sleep 5
+ echo "Functest reporting Tempest..."
+ report_project "functest" "functest" "tempest"
+ echo "reporting Tempest...OK"
+ sleep 5
else
if [ -z "$2" ]; then
reporting_type="status"
fi
- echo "********************************"
- echo " $project/$reporting_type reporting "
- echo "********************************"
- python ./$project/reporting-$reporting_type.py
+ report_project $project $project $reporting_type
fi
-cp -r display /usr/share/nginx/html
-
-
-# nginx config
-cp /home/opnfv/utils/test/reporting/docker/nginx.conf /etc/nginx/conf.d/
-echo "daemon off;" >> /etc/nginx/nginx.conf
-
-# supervisor config
-cp /home/opnfv/utils/test/reporting/docker/supervisor.conf /etc/supervisor/conf.d/
-
-ln -s /usr/bin/nodejs /usr/bin/node
-
-cd pages && /bin/bash angular.sh
diff --git a/reporting/docker/supervisor.conf b/reporting/docker/supervisor.conf
index b323dd0..49310d4 100644
--- a/reporting/docker/supervisor.conf
+++ b/reporting/docker/supervisor.conf
@@ -3,7 +3,7 @@ nodaemon = true
[program:tornado]
user = root
-directory = /home/opnfv/utils/test/reporting/api/api
+directory = /home/opnfv/releng/utils/test/reporting/api
command = python server.py --port=800%(process_num)d
process_name=%(program_name)s%(process_num)d
numprocs=4
@@ -15,5 +15,5 @@ command = service nginx restart
[program:configuration]
user = root
-directory = /home/opnfv/utils/test/reporting/pages
+directory = /home/opnfv/releng/utils/test/reporting/pages
command = bash config.sh
diff --git a/reporting/docker/web_server.sh b/reporting/docker/web_server.sh
new file mode 100755
index 0000000..a34c11d
--- /dev/null
+++ b/reporting/docker/web_server.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+cp -r display /usr/share/nginx/html
+
+
+# nginx config
+cp /home/opnfv/releng/utils/test/reporting/docker/nginx.conf /etc/nginx/conf.d/
+echo "daemon off;" >> /etc/nginx/nginx.conf
+
+# supervisor config
+cp /home/opnfv/releng/utils/test/reporting/docker/supervisor.conf /etc/supervisor/conf.d/
+
+ln -s /usr/bin/nodejs /usr/bin/node
+
+# Manage Angular front end
+cd pages && /bin/bash angular.sh
+
diff --git a/reporting/docs/_build/.buildinfo b/reporting/docs/_build/.buildinfo
new file mode 100644
index 0000000..6bd6fd6
--- /dev/null
+++ b/reporting/docs/_build/.buildinfo
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 235ce07a48cec983846ad34dfd375b07
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/reporting/docs/_build/.doctrees/environment.pickle b/reporting/docs/_build/.doctrees/environment.pickle
new file mode 100644
index 0000000..23f59c3
--- /dev/null
+++ b/reporting/docs/_build/.doctrees/environment.pickle
Binary files differ
diff --git a/reporting/docs/_build/.doctrees/index.doctree b/reporting/docs/_build/.doctrees/index.doctree
new file mode 100644
index 0000000..51e2d5a
--- /dev/null
+++ b/reporting/docs/_build/.doctrees/index.doctree
Binary files differ
diff --git a/reporting/docs/conf.py b/reporting/docs/conf.py
new file mode 100644
index 0000000..2e70d2b
--- /dev/null
+++ b/reporting/docs/conf.py
@@ -0,0 +1,341 @@
+# -*- coding: utf-8 -*-
+#
+# OPNFV testing Reporting documentation build configuration file, created by
+# sphinx-quickstart on Mon July 4 10:03:43 2017.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ 'sphinx.ext.autodoc',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#
+# source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'OPNFV Reporting'
+copyright = u'2017, #opnfv-testperf (chat.freenode.net)'
+author = u'#opnfv-testperf (chat.freenode.net)'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u'master'
+# The full version, including alpha/beta/rc tags.
+release = u'master'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = 'en'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#
+# today = ''
+#
+# Else, today_fmt is used as the format for a strftime call.
+#
+# today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#
+# default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#
+# add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#
+# add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#
+# show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+# modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+# keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'alabaster'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#
+# html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+
+# The name for this set of Sphinx documents.
+# "<project> v<release> documentation" by default.
+#
+# html_title = u'OPNFV Functest vmaster'
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#
+# html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#
+# html_logo = None
+
+# The name of an image file (relative to this directory) to use as a favicon of
+# the docs. This file should be a Windows icon file (.ico) being 16x16 or
+# 32x32 pixels large.
+#
+# html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#
+# html_extra_path = []
+
+# If not None, a 'Last updated on:' timestamp is inserted at every page
+# bottom, using the given strftime format.
+# The empty string is equivalent to '%b %d, %Y'.
+#
+# html_last_updated_fmt = None
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#
+# html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#
+# html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#
+# html_additional_pages = {}
+
+# If false, no module index is generated.
+#
+# html_domain_indices = True
+
+# If false, no index is generated.
+#
+# html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#
+# html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#
+# html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#
+# html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#
+# html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#
+# html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+# html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
+# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
+#
+# html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# 'ja' uses this config value.
+# 'zh' user can custom change `jieba` dictionary path.
+#
+# html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#
+# html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'OPNFVreportingdoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ #
+ # 'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ #
+ # 'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ #
+ # 'preamble': '',
+
+ # Latex figure (float) alignment
+ #
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'OPNFVReporting.tex',
+ u'OPNFV testing Reporting Documentation',
+ u'\\#opnfv-testperf (chat.freenode.net)', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#
+# latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+#
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#
+# latex_appendices = []
+
+# It false, will not define \strong, \code, itleref, \crossref ... but only
+# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
+# packages.
+#
+# latex_keep_old_macro_names = True
+
+# If false, no module index is generated.
+#
+# latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (master_doc, 'opnfvReporting', u'OPNFV Testing Reporting Documentation',
+ [author], 1)
+]
+
+# If true, show URL addresses after external links.
+#
+# man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'OPNFVReporting', u'OPNFV Testing reporting Documentation',
+ author, 'OPNFVTesting', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#
+# texinfo_appendices = []
+
+# If false, no module index is generated.
+#
+# texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#
+# texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#
+# texinfo_no_detailmenu = False
diff --git a/reporting/docs/index.rst b/reporting/docs/index.rst
new file mode 100644
index 0000000..af41876
--- /dev/null
+++ b/reporting/docs/index.rst
@@ -0,0 +1,16 @@
+Welcome to OPNFV Testing reporting documentation!
+=================================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/reporting/functest/__init__.py b/reporting/reporting/__init__.py
index e69de29..e69de29 100644
--- a/reporting/functest/__init__.py
+++ b/reporting/reporting/__init__.py
diff --git a/reporting/qtip/__init__.py b/reporting/reporting/functest/__init__.py
index e69de29..e69de29 100644
--- a/reporting/qtip/__init__.py
+++ b/reporting/reporting/functest/__init__.py
diff --git a/reporting/functest/img/gauge_0.png b/reporting/reporting/functest/img/gauge_0.png
index ecefc0e..ecefc0e 100644
--- a/reporting/functest/img/gauge_0.png
+++ b/reporting/reporting/functest/img/gauge_0.png
Binary files differ
diff --git a/reporting/functest/img/gauge_100.png b/reporting/reporting/functest/img/gauge_100.png
index e199e15..e199e15 100644
--- a/reporting/functest/img/gauge_100.png
+++ b/reporting/reporting/functest/img/gauge_100.png
Binary files differ
diff --git a/reporting/functest/img/gauge_16.7.png b/reporting/reporting/functest/img/gauge_16.7.png
index 3e3993c..3e3993c 100644
--- a/reporting/functest/img/gauge_16.7.png
+++ b/reporting/reporting/functest/img/gauge_16.7.png
Binary files differ
diff --git a/reporting/functest/img/gauge_25.png b/reporting/reporting/functest/img/gauge_25.png
index 4923659..4923659 100644
--- a/reporting/functest/img/gauge_25.png
+++ b/reporting/reporting/functest/img/gauge_25.png
Binary files differ
diff --git a/reporting/functest/img/gauge_33.3.png b/reporting/reporting/functest/img/gauge_33.3.png
index 364574b..364574b 100644
--- a/reporting/functest/img/gauge_33.3.png
+++ b/reporting/reporting/functest/img/gauge_33.3.png
Binary files differ
diff --git a/reporting/functest/img/gauge_41.7.png b/reporting/reporting/functest/img/gauge_41.7.png
index 8c3e910..8c3e910 100644
--- a/reporting/functest/img/gauge_41.7.png
+++ b/reporting/reporting/functest/img/gauge_41.7.png
Binary files differ
diff --git a/reporting/functest/img/gauge_50.png b/reporting/reporting/functest/img/gauge_50.png
index 2874b9f..2874b9f 100644
--- a/reporting/functest/img/gauge_50.png
+++ b/reporting/reporting/functest/img/gauge_50.png
Binary files differ
diff --git a/reporting/functest/img/gauge_58.3.png b/reporting/reporting/functest/img/gauge_58.3.png
index beedc8a..beedc8a 100644
--- a/reporting/functest/img/gauge_58.3.png
+++ b/reporting/reporting/functest/img/gauge_58.3.png
Binary files differ
diff --git a/reporting/functest/img/gauge_66.7.png b/reporting/reporting/functest/img/gauge_66.7.png
index 93f44d1..93f44d1 100644
--- a/reporting/functest/img/gauge_66.7.png
+++ b/reporting/reporting/functest/img/gauge_66.7.png
Binary files differ
diff --git a/reporting/functest/img/gauge_75.png b/reporting/reporting/functest/img/gauge_75.png
index 9fc261f..9fc261f 100644
--- a/reporting/functest/img/gauge_75.png
+++ b/reporting/reporting/functest/img/gauge_75.png
Binary files differ
diff --git a/reporting/functest/img/gauge_8.3.png b/reporting/reporting/functest/img/gauge_8.3.png
index 59f8657..59f8657 100644
--- a/reporting/functest/img/gauge_8.3.png
+++ b/reporting/reporting/functest/img/gauge_8.3.png
Binary files differ
diff --git a/reporting/functest/img/gauge_83.3.png b/reporting/reporting/functest/img/gauge_83.3.png
index 27ae4ec..27ae4ec 100644
--- a/reporting/functest/img/gauge_83.3.png
+++ b/reporting/reporting/functest/img/gauge_83.3.png
Binary files differ
diff --git a/reporting/functest/img/gauge_91.7.png b/reporting/reporting/functest/img/gauge_91.7.png
index 2808657..2808657 100644
--- a/reporting/functest/img/gauge_91.7.png
+++ b/reporting/reporting/functest/img/gauge_91.7.png
Binary files differ
diff --git a/reporting/functest/img/icon-nok.png b/reporting/reporting/functest/img/icon-nok.png
index 526b529..526b529 100644
--- a/reporting/functest/img/icon-nok.png
+++ b/reporting/reporting/functest/img/icon-nok.png
Binary files differ
diff --git a/reporting/functest/img/icon-ok.png b/reporting/reporting/functest/img/icon-ok.png
index 3a9de2e..3a9de2e 100644
--- a/reporting/functest/img/icon-ok.png
+++ b/reporting/reporting/functest/img/icon-ok.png
Binary files differ
diff --git a/reporting/functest/img/weather-clear.png b/reporting/reporting/functest/img/weather-clear.png
index a0d9677..a0d9677 100644
--- a/reporting/functest/img/weather-clear.png
+++ b/reporting/reporting/functest/img/weather-clear.png
Binary files differ
diff --git a/reporting/functest/img/weather-few-clouds.png b/reporting/reporting/functest/img/weather-few-clouds.png
index acfa783..acfa783 100644
--- a/reporting/functest/img/weather-few-clouds.png
+++ b/reporting/reporting/functest/img/weather-few-clouds.png
Binary files differ
diff --git a/reporting/functest/img/weather-overcast.png b/reporting/reporting/functest/img/weather-overcast.png
index 4296246..4296246 100644
--- a/reporting/functest/img/weather-overcast.png
+++ b/reporting/reporting/functest/img/weather-overcast.png
Binary files differ
diff --git a/reporting/functest/img/weather-storm.png b/reporting/reporting/functest/img/weather-storm.png
index 956f0e2..956f0e2 100644
--- a/reporting/functest/img/weather-storm.png
+++ b/reporting/reporting/functest/img/weather-storm.png
Binary files differ
diff --git a/reporting/functest/index.html b/reporting/reporting/functest/index.html
index bb1bce2..bb1bce2 100644
--- a/reporting/functest/index.html
+++ b/reporting/reporting/functest/index.html
diff --git a/reporting/functest/reporting-status.py b/reporting/reporting/functest/reporting-status.py
index 77ab784..48c4bb1 100755
--- a/reporting/functest/reporting-status.py
+++ b/reporting/reporting/functest/reporting-status.py
@@ -18,6 +18,8 @@ import scenarioResult as sr
# manage conf
import utils.reporting_utils as rp_utils
+"""Functest reporting status"""
+
# Logger
logger = rp_utils.getLogger("Functest-Status")
@@ -272,7 +274,8 @@ for version in versions:
templateEnv = jinja2.Environment(
loader=templateLoader, autoescape=True)
- TEMPLATE_FILE = "./functest/template/index-status-tmpl.html"
+ TEMPLATE_FILE = ("./reporting/functest/template"
+ "/index-status-tmpl.html")
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(
diff --git a/reporting/functest/reporting-tempest.py b/reporting/reporting/functest/reporting-tempest.py
index 0304298..bc28856 100755
--- a/reporting/functest/reporting-tempest.py
+++ b/reporting/reporting/functest/reporting-tempest.py
@@ -142,7 +142,7 @@ for version in rp_utils.get_config('general.versions'):
templateEnv = jinja2.Environment(loader=templateLoader,
autoescape=True)
- TEMPLATE_FILE = "./functest/template/index-tempest-tmpl.html"
+ TEMPLATE_FILE = "./reporting/functest/template/index-tempest-tmpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(scenario_results=scenario_results,
diff --git a/reporting/functest/reporting-vims.py b/reporting/reporting/functest/reporting-vims.py
index b236b89..14fddbe 100755
--- a/reporting/functest/reporting-vims.py
+++ b/reporting/reporting/functest/reporting-vims.py
@@ -104,7 +104,7 @@ for version in versions:
% result['details']['sig_test']['duration'])
logger.debug("Signaling testing results: %s"
% format_result)
- except:
+ except Exception:
logger.error("Data badly formatted")
logger.debug("----------------------------------------")
@@ -112,7 +112,7 @@ for version in versions:
templateEnv = jinja2.Environment(loader=templateLoader,
autoescape=True)
- TEMPLATE_FILE = "./functest/template/index-vims-tmpl.html"
+ TEMPLATE_FILE = "./reporting/functest/template/index-vims-tmpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(scenario_results=scenario_results,
diff --git a/reporting/functest/scenarioResult.py b/reporting/reporting/functest/scenarioResult.py
index 5a54eed..5a54eed 100644
--- a/reporting/functest/scenarioResult.py
+++ b/reporting/reporting/functest/scenarioResult.py
diff --git a/reporting/functest/template/index-status-tmpl.html b/reporting/reporting/functest/template/index-status-tmpl.html
index cc4edaa..cc4edaa 100644
--- a/reporting/functest/template/index-status-tmpl.html
+++ b/reporting/reporting/functest/template/index-status-tmpl.html
diff --git a/reporting/functest/template/index-tempest-tmpl.html b/reporting/reporting/functest/template/index-tempest-tmpl.html
index 3a22227..3a22227 100644
--- a/reporting/functest/template/index-tempest-tmpl.html
+++ b/reporting/reporting/functest/template/index-tempest-tmpl.html
diff --git a/reporting/functest/template/index-vims-tmpl.html b/reporting/reporting/functest/template/index-vims-tmpl.html
index cd51607..cd51607 100644
--- a/reporting/functest/template/index-vims-tmpl.html
+++ b/reporting/reporting/functest/template/index-vims-tmpl.html
diff --git a/reporting/functest/testCase.py b/reporting/reporting/functest/testCase.py
index 9834f07..9834f07 100644
--- a/reporting/functest/testCase.py
+++ b/reporting/reporting/functest/testCase.py
diff --git a/reporting/tests/__init__.py b/reporting/reporting/qtip/__init__.py
index e69de29..e69de29 100644
--- a/reporting/tests/__init__.py
+++ b/reporting/reporting/qtip/__init__.py
diff --git a/reporting/qtip/index.html b/reporting/reporting/qtip/index.html
index 0f9df85..0f9df85 100644
--- a/reporting/qtip/index.html
+++ b/reporting/reporting/qtip/index.html
diff --git a/reporting/qtip/reporting-status.py b/reporting/reporting/qtip/reporting-status.py
index 5967cf6..f0127b5 100644
--- a/reporting/qtip/reporting-status.py
+++ b/reporting/reporting/qtip/reporting-status.py
@@ -23,7 +23,7 @@ reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
logger.info("*******************************************")
logger.info("* Generating reporting scenario status *")
-logger.info("* Data retention = %s days *" % PERIOD)
+logger.info("* Data retention = {} days *".format(PERIOD))
logger.info("* *")
logger.info("*******************************************")
@@ -33,7 +33,8 @@ def prepare_profile_file(version):
if not os.path.exists(profile_dir):
os.makedirs(profile_dir)
- profile_file = '{}/scenario_history.txt'.format(profile_dir, version)
+ profile_file = "{}/{}/scenario_history.txt".format(profile_dir,
+ version)
if not os.path.exists(profile_file):
with open(profile_file, 'w') as f:
info = 'date,scenario,installer,details,score\n'
@@ -77,7 +78,7 @@ def render_html(prof_results, installer, version):
template_env = jinja2.Environment(loader=template_loader,
autoescape=True)
- template_file = "./qtip/template/index-status-tmpl.html"
+ template_file = "./reporting/qtip/template/index-status-tmpl.html"
template = template_env.get_template(template_file)
render_outcome = template.render(prof_results=prof_results,
@@ -106,5 +107,6 @@ def render_reporter():
rp_utils.generate_csv(profile_file)
logger.info("CSV generated...")
+
if __name__ == '__main__':
render_reporter()
diff --git a/reporting/qtip/template/index-status-tmpl.html b/reporting/reporting/qtip/template/index-status-tmpl.html
index 26da36c..26da36c 100644
--- a/reporting/qtip/template/index-status-tmpl.html
+++ b/reporting/reporting/qtip/template/index-status-tmpl.html
diff --git a/reporting/reporting.yaml b/reporting/reporting/reporting.yaml
index 1692f48..1692f48 100644
--- a/reporting/reporting.yaml
+++ b/reporting/reporting/reporting.yaml
diff --git a/reporting/tests/unit/__init__.py b/reporting/reporting/storperf/__init__.py
index e69de29..e69de29 100644
--- a/reporting/tests/unit/__init__.py
+++ b/reporting/reporting/storperf/__init__.py
diff --git a/reporting/storperf/reporting-status.py b/reporting/reporting/storperf/reporting-status.py
index 888e339..0c188a3 100644
--- a/reporting/storperf/reporting-status.py
+++ b/reporting/reporting/storperf/reporting-status.py
@@ -131,7 +131,7 @@ for version in versions:
templateEnv = jinja2.Environment(loader=templateLoader,
autoescape=True)
- TEMPLATE_FILE = "./storperf/template/index-status-tmpl.html"
+ TEMPLATE_FILE = "./reporting/storperf/template/index-status-tmpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(scenario_results=scenario_result_criteria,
diff --git a/reporting/storperf/template/index-status-tmpl.html b/reporting/reporting/storperf/template/index-status-tmpl.html
index e872272..e872272 100644
--- a/reporting/storperf/template/index-status-tmpl.html
+++ b/reporting/reporting/storperf/template/index-status-tmpl.html
diff --git a/reporting/tests/unit/utils/__init__.py b/reporting/reporting/tests/__init__.py
index e69de29..e69de29 100644
--- a/reporting/tests/unit/utils/__init__.py
+++ b/reporting/reporting/tests/__init__.py
diff --git a/reporting/utils/__init__.py b/reporting/reporting/tests/unit/__init__.py
index e69de29..e69de29 100644
--- a/reporting/utils/__init__.py
+++ b/reporting/reporting/tests/unit/__init__.py
diff --git a/reporting/reporting/tests/unit/utils/__init__.py b/reporting/reporting/tests/unit/utils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/reporting/reporting/tests/unit/utils/__init__.py
diff --git a/reporting/tests/unit/utils/test_utils.py b/reporting/reporting/tests/unit/utils/test_utils.py
index b9c3980..9614d74 100644
--- a/reporting/tests/unit/utils/test_utils.py
+++ b/reporting/reporting/tests/unit/utils/test_utils.py
@@ -10,7 +10,7 @@
import logging
import unittest
-from utils import reporting_utils
+from reporting.utils import reporting_utils
class reportingUtilsTesting(unittest.TestCase):
@@ -20,10 +20,9 @@ class reportingUtilsTesting(unittest.TestCase):
def setUp(self):
self.test = reporting_utils
- def test_getConfig(self):
- self.assertEqual(self.test.get_config("general.period"), 10)
-# TODO
-# ...
+ def test_foo(self):
+ self.assertTrue(0 < 1)
+
if __name__ == "__main__":
unittest.main(verbosity=2)
diff --git a/reporting/reporting/utils/__init__.py b/reporting/reporting/utils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/reporting/reporting/utils/__init__.py
diff --git a/reporting/utils/reporting_utils.py b/reporting/reporting/utils/reporting_utils.py
index 0a178ba..6282091 100644
--- a/reporting/utils/reporting_utils.py
+++ b/reporting/reporting/utils/reporting_utils.py
@@ -95,7 +95,7 @@ def getApiResults(case, installer, scenario, version):
k = response.read()
results = json.loads(k)
except URLError as e:
- print('No kittez. Got an error code:', e)
+ print 'No kittez. Got an error code:'.format(e)
return results
@@ -124,19 +124,21 @@ def getScenarios(case, installer, version):
k = response.read()
results = json.loads(k)
test_results = results['results']
-
- page = results['pagination']['total_pages']
- if page > 1:
- test_results = []
- for i in range(1, page + 1):
- url_page = url + "&page=" + str(i)
- request = Request(url_page)
- response = urlopen(request)
- k = response.read()
- results = json.loads(k)
- test_results += results['results']
+ try:
+ page = results['pagination']['total_pages']
+ if page > 1:
+ test_results = []
+ for i in range(1, page + 1):
+ url_page = url + "&page=" + str(i)
+ request = Request(url_page)
+ response = urlopen(request)
+ k = response.read()
+ results = json.loads(k)
+ test_results += results['results']
+ except KeyError:
+ print ('No pagination detected')
except URLError as err:
- print('Got an error code:', err)
+ print 'Got an error code: {}'.format(err)
if test_results is not None:
test_results.reverse()
@@ -152,7 +154,7 @@ def getScenarios(case, installer, version):
exclude_noha = get_config('functest.exclude_noha')
if ((exclude_virtual_pod and "virtual" in r['pod_name']) or
(exclude_noha and "noha" in r['scenario'])):
- print("exclude virtual pod results...")
+ print "exclude virtual pod results..."
else:
scenario_results[r['scenario']].append(r)
@@ -183,7 +185,7 @@ def getScenarioStatus(installer, version):
results = json.loads(k)
test_results = results['results']
except URLError as e:
- print('Got an error code:', e)
+ print 'Got an error code: {}'.format(e)
scenario_results = {}
result_dict = {}
@@ -223,7 +225,7 @@ def getQtipResults(version, installer):
response.close()
results = json.loads(k)['results']
except URLError as err:
- print('Got an error code:', err)
+ print 'Got an error code: {}'.format(err)
result_dict = {}
if results:
@@ -245,7 +247,7 @@ def getNbtestOk(results):
if "PASS" in v:
nb_test_ok += 1
except:
- print("Cannot retrieve test status")
+ print "Cannot retrieve test status"
return nb_test_ok
@@ -320,7 +322,7 @@ def getJenkinsUrl(build_tag):
"/" + str(build_id[0]))
jenkins_url = url_base + url_id + "/console"
except:
- print('Impossible to get jenkins url:')
+ print 'Impossible to get jenkins url:'
if "jenkins-" not in build_tag:
jenkins_url = None
@@ -333,7 +335,7 @@ def getScenarioPercent(scenario_score, scenario_criteria):
try:
score = float(scenario_score) / float(scenario_criteria) * 100
except:
- print('Impossible to calculate the percentage score')
+ print 'Impossible to calculate the percentage score'
return score
@@ -419,7 +421,7 @@ def get_percent(four_list, ten_list):
def _test():
status = getScenarioStatus("compass", "master")
- print("status:++++++++++++++++++++++++")
+ print "status:++++++++++++++++++++++++"
print(json.dumps(status, indent=4))
@@ -456,6 +458,6 @@ 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...")
+ print "Error but pdf generated anyway..."
except:
- print("impossible to generate PDF")
+ print "impossible to generate PDF"
diff --git a/reporting/utils/scenarioResult.py b/reporting/reporting/utils/scenarioResult.py
index 6029d7f..6029d7f 100644
--- a/reporting/utils/scenarioResult.py
+++ b/reporting/reporting/utils/scenarioResult.py
diff --git a/reporting/reporting/yardstick/__init__.py b/reporting/reporting/yardstick/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/reporting/reporting/yardstick/__init__.py
diff --git a/reporting/yardstick/img/gauge_0.png b/reporting/reporting/yardstick/img/gauge_0.png
index ecefc0e..ecefc0e 100644
--- a/reporting/yardstick/img/gauge_0.png
+++ b/reporting/reporting/yardstick/img/gauge_0.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_100.png b/reporting/reporting/yardstick/img/gauge_100.png
index e199e15..e199e15 100644
--- a/reporting/yardstick/img/gauge_100.png
+++ b/reporting/reporting/yardstick/img/gauge_100.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_16.7.png b/reporting/reporting/yardstick/img/gauge_16.7.png
index 3e3993c..3e3993c 100644
--- a/reporting/yardstick/img/gauge_16.7.png
+++ b/reporting/reporting/yardstick/img/gauge_16.7.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_25.png b/reporting/reporting/yardstick/img/gauge_25.png
index 4923659..4923659 100644
--- a/reporting/yardstick/img/gauge_25.png
+++ b/reporting/reporting/yardstick/img/gauge_25.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_33.3.png b/reporting/reporting/yardstick/img/gauge_33.3.png
index 364574b..364574b 100644
--- a/reporting/yardstick/img/gauge_33.3.png
+++ b/reporting/reporting/yardstick/img/gauge_33.3.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_41.7.png b/reporting/reporting/yardstick/img/gauge_41.7.png
index 8c3e910..8c3e910 100644
--- a/reporting/yardstick/img/gauge_41.7.png
+++ b/reporting/reporting/yardstick/img/gauge_41.7.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_50.png b/reporting/reporting/yardstick/img/gauge_50.png
index 2874b9f..2874b9f 100644
--- a/reporting/yardstick/img/gauge_50.png
+++ b/reporting/reporting/yardstick/img/gauge_50.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_58.3.png b/reporting/reporting/yardstick/img/gauge_58.3.png
index beedc8a..beedc8a 100644
--- a/reporting/yardstick/img/gauge_58.3.png
+++ b/reporting/reporting/yardstick/img/gauge_58.3.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_66.7.png b/reporting/reporting/yardstick/img/gauge_66.7.png
index 93f44d1..93f44d1 100644
--- a/reporting/yardstick/img/gauge_66.7.png
+++ b/reporting/reporting/yardstick/img/gauge_66.7.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_75.png b/reporting/reporting/yardstick/img/gauge_75.png
index 9fc261f..9fc261f 100644
--- a/reporting/yardstick/img/gauge_75.png
+++ b/reporting/reporting/yardstick/img/gauge_75.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_8.3.png b/reporting/reporting/yardstick/img/gauge_8.3.png
index 59f8657..59f8657 100644
--- a/reporting/yardstick/img/gauge_8.3.png
+++ b/reporting/reporting/yardstick/img/gauge_8.3.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_83.3.png b/reporting/reporting/yardstick/img/gauge_83.3.png
index 27ae4ec..27ae4ec 100644
--- a/reporting/yardstick/img/gauge_83.3.png
+++ b/reporting/reporting/yardstick/img/gauge_83.3.png
Binary files differ
diff --git a/reporting/yardstick/img/gauge_91.7.png b/reporting/reporting/yardstick/img/gauge_91.7.png
index 2808657..2808657 100644
--- a/reporting/yardstick/img/gauge_91.7.png
+++ b/reporting/reporting/yardstick/img/gauge_91.7.png
Binary files differ
diff --git a/reporting/yardstick/img/icon-nok.png b/reporting/reporting/yardstick/img/icon-nok.png
index 526b529..526b529 100644
--- a/reporting/yardstick/img/icon-nok.png
+++ b/reporting/reporting/yardstick/img/icon-nok.png
Binary files differ
diff --git a/reporting/yardstick/img/icon-ok.png b/reporting/reporting/yardstick/img/icon-ok.png
index 3a9de2e..3a9de2e 100644
--- a/reporting/yardstick/img/icon-ok.png
+++ b/reporting/reporting/yardstick/img/icon-ok.png
Binary files differ
diff --git a/reporting/yardstick/img/weather-clear.png b/reporting/reporting/yardstick/img/weather-clear.png
index a0d9677..a0d9677 100644
--- a/reporting/yardstick/img/weather-clear.png
+++ b/reporting/reporting/yardstick/img/weather-clear.png
Binary files differ
diff --git a/reporting/yardstick/img/weather-few-clouds.png b/reporting/reporting/yardstick/img/weather-few-clouds.png
index acfa783..acfa783 100644
--- a/reporting/yardstick/img/weather-few-clouds.png
+++ b/reporting/reporting/yardstick/img/weather-few-clouds.png
Binary files differ
diff --git a/reporting/yardstick/img/weather-overcast.png b/reporting/reporting/yardstick/img/weather-overcast.png
index 4296246..4296246 100644
--- a/reporting/yardstick/img/weather-overcast.png
+++ b/reporting/reporting/yardstick/img/weather-overcast.png
Binary files differ
diff --git a/reporting/yardstick/img/weather-storm.png b/reporting/reporting/yardstick/img/weather-storm.png
index 956f0e2..956f0e2 100644
--- a/reporting/yardstick/img/weather-storm.png
+++ b/reporting/reporting/yardstick/img/weather-storm.png
Binary files differ
diff --git a/reporting/yardstick/index.html b/reporting/reporting/yardstick/index.html
index 488f142..488f142 100644
--- a/reporting/yardstick/index.html
+++ b/reporting/reporting/yardstick/index.html
diff --git a/reporting/yardstick/reporting-status.py b/reporting/reporting/yardstick/reporting-status.py
index 12f42ca..85c386b 100644
--- a/reporting/yardstick/reporting-status.py
+++ b/reporting/reporting/yardstick/reporting-status.py
@@ -106,7 +106,7 @@ for version in versions:
templateEnv = jinja2.Environment(loader=templateLoader,
autoescape=True)
- TEMPLATE_FILE = "./yardstick/template/index-status-tmpl.html"
+ TEMPLATE_FILE = "./reporting/yardstick/template/index-status-tmpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
outputText = template.render(scenario_results=scenario_result_criteria,
diff --git a/reporting/yardstick/scenarios.py b/reporting/reporting/yardstick/scenarios.py
index 26e8c8b..26e8c8b 100644
--- a/reporting/yardstick/scenarios.py
+++ b/reporting/reporting/yardstick/scenarios.py
diff --git a/reporting/yardstick/template/index-status-tmpl.html b/reporting/reporting/yardstick/template/index-status-tmpl.html
index 77ba950..77ba950 100644
--- a/reporting/yardstick/template/index-status-tmpl.html
+++ b/reporting/reporting/yardstick/template/index-status-tmpl.html
diff --git a/reporting/requirements.txt b/reporting/requirements.txt
new file mode 100644
index 0000000..344064d
--- /dev/null
+++ b/reporting/requirements.txt
@@ -0,0 +1,7 @@
+pdfkit>=0.6.1 # MIT
+wkhtmltopdf-pack>=0.12.3 # MIT
+PyYAML>=3.10.0 # MIT
+simplejson>=2.2.0 # MIT
+Jinja2!=2.9.0,!=2.9.1,!=2.9.2,!=2.9.3,!=2.9.4,>=2.8 # BSD License (3 clause)
+requests!=2.12.2,>=2.10.0 # Apache-2.0
+tornado>=4.4.2 # Apache-2.0
diff --git a/reporting/run_test.sh b/reporting/run_test.sh
index 8c674ce..b83b550 100755
--- a/reporting/run_test.sh
+++ b/reporting/run_test.sh
@@ -1,44 +1,3 @@
#!/bin/bash
-set -o errexit
-set -o pipefail
-
-
-# Get script directory
-SCRIPTDIR=`dirname $0`
-
-# Creating virtual environment
-if [ ! -z $VIRTUAL_ENV ]; then
- venv=$VIRTUAL_ENV
-else
- venv=$SCRIPTDIR/.venv
- virtualenv $venv
-fi
-
-source $venv/bin/activate
-
-export CONFIG_REPORTING_YAML=$SCRIPTDIR/reporting.yaml
-
-# ***************
-# Run unit tests
-# ***************
-echo "Running unit tests..."
-
-# install python packages
-easy_install -U setuptools
-easy_install -U pip
-pip install -r $SCRIPTDIR/docker/requirements.pip
-pip install -e $SCRIPTDIR
-
-python $SCRIPTDIR/setup.py develop
-
-# unit tests
-# TODO: remove cover-erase
-# To be deleted when all functest packages will be listed
-nosetests --with-xunit \
- --cover-package=$SCRIPTDIR/utils \
- --with-coverage \
- --cover-xml \
- $SCRIPTDIR/tests/unit
-rc=$?
-
-deactivate
+tox
+exit $?
diff --git a/reporting/setup.cfg b/reporting/setup.cfg
new file mode 100644
index 0000000..9543945
--- /dev/null
+++ b/reporting/setup.cfg
@@ -0,0 +1,12 @@
+[metadata]
+name = reporting
+version = 1
+home-page = https://wiki.opnfv.org/display/testing
+
+[files]
+packages =
+ reporting
+ api
+scripts =
+ docker/reporting.sh
+ docker/web_server.sh
diff --git a/reporting/setup.py b/reporting/setup.py
index 627785e..a52d905 100644
--- a/reporting/setup.py
+++ b/reporting/setup.py
@@ -1,22 +1,24 @@
-##############################################################################
+#!/usr/bin/env python
+
+# Copyright (c) 2017 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
-##############################################################################
-from setuptools import setup, find_packages
+# pylint: disable=missing-docstring
+
+import setuptools
+# In python < 2.7.4, a lazy loading of package `pbr` will break
+# setuptools if some other modules registered functions in `atexit`.
+# solution from: http://bugs.python.org/issue15881#msg170215
+try:
+ import multiprocessing # noqa
+except ImportError:
+ pass
-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"],
-)
+setuptools.setup(
+ setup_requires=['pbr>=1.8'],
+ pbr=True)
diff --git a/reporting/test-requirements.txt b/reporting/test-requirements.txt
new file mode 100644
index 0000000..738f508
--- /dev/null
+++ b/reporting/test-requirements.txt
@@ -0,0 +1,5 @@
+coverage>=4.0 # Apache-2.0
+mock>=2.0 # BSD
+nose # LGPL
+flake8<2.6.0,>=2.5.4 # MIT
+pylint==1.4.5 # GPLv2
diff --git a/reporting/tox.ini b/reporting/tox.ini
new file mode 100644
index 0000000..2df5030
--- /dev/null
+++ b/reporting/tox.ini
@@ -0,0 +1,27 @@
+[tox]
+envlist = pep8,pylint,py27
+
+[testenv]
+usedevelop = True
+deps =
+ -r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+commands = nosetests --with-xunit \
+ --with-coverage \
+ --cover-tests \
+ --cover-package=reporting \
+ --cover-xml \
+ --cover-html \
+ reporting/tests/unit
+
+[testenv:pep8]
+basepython = python2.7
+commands = flake8
+
+[testenv:pylint]
+basepython = python2.7
+whitelist_externals = bash
+commands =
+ bash -c "\
+ pylint --disable=locally-disabled reporting| \
+ tee pylint.out | sed -ne '/Raw metrics/,//p'"