diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-03-01 09:46:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-03-01 09:46:17 +0000 |
commit | 6465acb2265cdc918e4e8f37f3b9b15327b91553 (patch) | |
tree | 15e38b0c1261aa82ebd7af55bf015f4dbe90edc0 | |
parent | 858c260bcec2c3e4c66e15be8432a53f05a7ce20 (diff) | |
parent | 9cafa08b7d05c9fb741456527e0c126bd89b6068 (diff) |
Merge "Add tempest success rate to calculate the % of success results"
-rw-r--r-- | utils/test/result_collection_api/dashboard/functest2Dashboard.py | 19 |
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 |