diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-02-29 14:59:40 +0100 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-02-29 14:59:40 +0100 |
commit | ce1601c7e26af95109f0c2954d2d6ddd36d6c8a9 (patch) | |
tree | 1fef94a6d52efdbec7d2704fe7c9376cc6eb9b03 /result_collection_api/dashboard | |
parent | 56503cb199a465de834eb9343f2fb74ec04610a8 (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 'result_collection_api/dashboard')
-rw-r--r-- | result_collection_api/dashboard/functest2Dashboard.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/result_collection_api/dashboard/functest2Dashboard.py b/result_collection_api/dashboard/functest2Dashboard.py index 3f4e1a2..a2ed308 100644 --- a/result_collection_api/dashboard/functest2Dashboard.py +++ b/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 |