summaryrefslogtreecommitdiffstats
path: root/utils/test
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-02-29 14:59:40 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-02-29 14:59:40 +0100
commit9cafa08b7d05c9fb741456527e0c126bd89b6068 (patch)
treec95c377832e279254c9a200c501e4add0289694e /utils/test
parent50add39545ffa50b6e373e94789a9979b3777cdb (diff)
Add tempest success rate to calculate the % of success results
Change-Id: I38c76904648253601258e5a048ea6bc53821c313 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'utils/test')
-rw-r--r--utils/test/result_collection_api/dashboard/functest2Dashboard.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/test/result_collection_api/dashboard/functest2Dashboard.py b/utils/test/result_collection_api/dashboard/functest2Dashboard.py
index 3f4e1a2db..a2ed3085c 100644
--- a/utils/test/result_collection_api/dashboard/functest2Dashboard.py
+++ b/utils/test/result_collection_api/dashboard/functest2Dashboard.py
@@ -213,6 +213,25 @@ def format_Tempest_for_dashboard(results):
'data_set': [{'Run': nbTests,
'Failed': nbFailures}]})
+ # Graph 4: (Success rate)=f(time)
+ # ***************************************
+ new_element = []
+ for data in results:
+ try:
+ diff = (int(data['details']['tests']) - int(data['details']['failures']))
+ success_rate = 100*diff/int(data['details']['tests'])
+ except:
+ success_rate = 0
+
+ new_element.append({'x': data['creation_date'],
+ 'y1': success_rate})
+
+ test_data.append({'name': "Tempest success rate",
+ 'info': {'type': "graph",
+ 'xlabel': 'time',
+ 'y1label': 'Success rate'},
+ 'data_set': new_element})
+
return test_data