diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-04-20 18:04:41 +0200 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-04-20 18:04:41 +0200 |
commit | c55d6b5dfc8f184a634a40785c84806a7b7922d8 (patch) | |
tree | bee30313aba615cb6f2dbca523b702d72cf20725 /result_collection_api | |
parent | 7071fd2f6846722aec7ae531cf85331acfab523c (diff) |
bug fix: Rally duration not correct due to result format change
JIRA: FUNCTEST-207
Change-Id: I04892271008a8a7130dbaf39757ab3039167602e
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'result_collection_api')
-rw-r--r-- | result_collection_api/dashboard/functest2Dashboard.py | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/result_collection_api/dashboard/functest2Dashboard.py b/result_collection_api/dashboard/functest2Dashboard.py index a2ed308..379b932 100644 --- a/result_collection_api/dashboard/functest2Dashboard.py +++ b/result_collection_api/dashboard/functest2Dashboard.py @@ -117,12 +117,15 @@ def format_vIMS_for_dashboard(results): # Calculate nb of tests run and nb of tests failed # vIMS_results = get_vIMSresults(vIMS_test) # print vIMS_results - if data_test['result'] == "Passed": - nbTests += 1 - elif data_test['result'] == "Failed": - nbFailures += 1 - elif data_test['result'] == "Skipped": - nbSkipped += 1 + try: + if data_test['result'] == "Passed": + nbTests += 1 + elif data_test['result'] == "Failed": + nbFailures += 1 + elif data_test['result'] == "Skipped": + nbSkipped += 1 + except: + nbTests = 0 new_element.append({'x': data['creation_date'], 'y1': nbTests, @@ -149,10 +152,13 @@ def format_vIMS_for_dashboard(results): nbTestsOK = 0 nbTestsKO = 0 - if data_test['result'] == "Passed": - nbTestsOK += 1 - elif data_test['result'] == "Failed": - nbTestsKO += 1 + try: + if data_test['result'] == "Passed": + nbTestsOK += 1 + elif data_test['result'] == "Failed": + nbTestsKO += 1 + except: + nbTestsOK = 0 nbTests += nbTestsOK + nbTestsKO nbFailures += nbTestsKO @@ -366,7 +372,7 @@ def format_Rally_for_dashboard(results): # ******************************** new_element = [] for data in results: - summary_cursor = len(data) + summary_cursor = len(data['details']) - 1 new_element.append({'x': data['creation_date'], 'y': int(data['details'][summary_cursor]['summary']['duration'])}) |