From 2ffe80e268fdaa1949b50a514945ce2feb31b9b3 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Wed, 20 Apr 2016 18:04:41 +0200 Subject: bug fix: Rally duration not correct due to result format change JIRA: FUNCTEST-207 Change-Id: I04892271008a8a7130dbaf39757ab3039167602e Signed-off-by: Morgan Richomme --- .../dashboard/functest2Dashboard.py | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'utils/test') diff --git a/utils/test/result_collection_api/dashboard/functest2Dashboard.py b/utils/test/result_collection_api/dashboard/functest2Dashboard.py index a2ed3085c..379b93279 100644 --- a/utils/test/result_collection_api/dashboard/functest2Dashboard.py +++ b/utils/test/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'])}) -- cgit 1.2.3-korg