diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2015-10-19 16:25:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-10-19 16:25:53 +0000 |
commit | fc4cf76005e004ac113b874c3920e049932d39ec (patch) | |
tree | b70af29ece28d6f1667291748ca56cf4a184c6c3 | |
parent | 9bac2135377214cae8c6147511ef13f47368b2aa (diff) | |
parent | 19b84d5b949392fb0694dbcf21af8ea603634e8f (diff) |
Merge "create post processing for Tempest test"
-rw-r--r-- | utils/test/result_collection_api/dashboard/functest2Dashboard.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/utils/test/result_collection_api/dashboard/functest2Dashboard.py b/utils/test/result_collection_api/dashboard/functest2Dashboard.py index 427de76a5..688f0c28c 100644 --- a/utils/test/result_collection_api/dashboard/functest2Dashboard.py +++ b/utils/test/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 |