summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2015-10-19 17:19:44 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2015-10-19 18:06:48 +0200
commit72cb987e901627cacb4932f5ed7bf558b6cc6c78 (patch)
tree0e501d690cc34f3938959de2f83aa4d9d6ec09e8
parent901d25ce14b7b682872f997cfd6ac89ca718c870 (diff)
create post processing for Tempest test
JIRA: FUNCTEST-56 Change-Id: I4bfaa80ed2e93c89062a95db014a9a445c6a53de Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
-rw-r--r--result_collection_api/dashboard/functest2Dashboard.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/result_collection_api/dashboard/functest2Dashboard.py b/result_collection_api/dashboard/functest2Dashboard.py
index 427de76..688f0c2 100644
--- a/result_collection_api/dashboard/functest2Dashboard.py
+++ b/result_collection_api/dashboard/functest2Dashboard.py
@@ -58,6 +58,49 @@ def format_Tempest_for_dashboard(results):
Post processing for the Tempest test case
"""
test_data = [{'description': 'Tempest results for Dashboard'}]
+
+ # Graph 1: Test_Duration = f(time)
+ # ********************************
+ new_element = []
+ for data in results:
+ new_element.append({'x': data['creation_date'],
+ 'y': data['details']['duration']})
+
+ test_data.append({'name': "Tempest duration",
+ 'info': {'type': "graph",
+ 'xlabel': 'time',
+ 'ylabel': 'duration (s)'},
+ 'data_set': new_element})
+
+ # Graph 2: (Nb test, nb failure)=f(time)
+ # ***************************************
+ new_element = []
+ for data in results:
+ new_element.append({'x': data['creation_date'],
+ 'y1': data['details']['tests'],
+ 'y2': data['details']['failures']})
+
+ test_data.append({'name': "Tempest nb tests/nb failures",
+ 'info': {'type': "graph",
+ 'xlabel': 'time',
+ 'y1label': 'Number of tests',
+ 'y2label': 'Number of failures'},
+ 'data_set': new_element})
+
+ # Graph 3: bar graph Summ(nb tests run), Sum (nb tests failed)
+ # ********************************************************
+ nbTests = 0
+ nbFailures = 0
+
+ for data in results:
+ nbTests += data['details']['tests']
+ nbFailures += data['details']['failures']
+
+ test_data.append({'name': "Total number of tests run/failure tests",
+ 'info': {"type": "bar"},
+ 'data_set': [{'Run': nbTests,
+ 'Failed': nbFailures}]})
+
return test_data