From 9cafa08b7d05c9fb741456527e0c126bd89b6068 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Mon, 29 Feb 2016 14:59:40 +0100 Subject: Add tempest success rate to calculate the % of success results Change-Id: I38c76904648253601258e5a048ea6bc53821c313 Signed-off-by: Morgan Richomme --- .../dashboard/functest2Dashboard.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- cgit 1.2.3-korg