summaryrefslogtreecommitdiffstats
path: root/vnftest/dispatcher/http.py
diff options
context:
space:
mode:
authorMoshe <moshehoa@amdocs.com>2019-01-17 18:04:54 +0200
committerMoshe <moshehoa@amdocs.com>2019-01-17 18:05:01 +0200
commit6ed81bdf24927a0900d4857d7652ae48cc8c78b1 (patch)
tree821fff9c7ef18e7ce57ce353e75420900c896948 /vnftest/dispatcher/http.py
parent1112c6e3e6eae3aa10680b2d7b0d653de1a4bc0b (diff)
Refactor test reporting
Issue-ID: VNFSDK-350 Change-Id: I66a82ab56dd6702903e4d1edf776a6d29cb4e836 Signed-off-by: Moshe <moshehoa@amdocs.com>
Diffstat (limited to 'vnftest/dispatcher/http.py')
-rw-r--r--vnftest/dispatcher/http.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/vnftest/dispatcher/http.py b/vnftest/dispatcher/http.py
index da66c90..900792a 100644
--- a/vnftest/dispatcher/http.py
+++ b/vnftest/dispatcher/http.py
@@ -41,7 +41,7 @@ class HttpDispatcher(DispatchBase):
self.timeout = int(http_conf.get('timeout', 5))
self.target = http_conf.get('target', 'http://127.0.0.1:8000/results')
- def flush_result_data(self, data):
+ def flush_result_data(self, id, data):
if self.target == '':
# if the target was not set, do not do anything
LOG.error('Dispatcher target was not set, no data will'
@@ -54,28 +54,25 @@ class HttpDispatcher(DispatchBase):
self.criteria = result['criteria']
testcases = result['testcases']
- for case, data in testcases.items():
- self._upload_case_result(case, data)
+ for testcase in testcases:
+ self._upload_case_result(testcase)
- def _upload_case_result(self, case, data):
+ def _upload_case_result(self, testcase):
try:
- step_data = data.get('tc_data', [])[0]
+ step_data = testcase.get('steps', [])[0]
+ step_result = step_data['results'][0]
except IndexError:
current_time = datetime.now()
else:
- timestamp = float(step_data.get('timestamp', 0.0))
+ timestamp = float(step_result.get('timestamp', 0.0))
current_time = datetime.fromtimestamp(timestamp)
result = {
"project_name": "vnftest",
- "case_name": case,
+ "case_name": testcase['name'],
"description": "vnftest ci step status",
- "step": self.info.get('deploy_step'),
- "version": self.info.get('version'),
- "pod_name": self.info.get('pod_name'),
- "installer": self.info.get('installer'),
"build_tag": os.environ.get('BUILD_TAG'),
- "criteria": data.get('criteria'),
+ "criteria": testcase.get('criteria'),
"start_date": current_time.strftime('%Y-%m-%d %H:%M:%S'),
"stop_date": current_time.strftime('%Y-%m-%d %H:%M:%S'),
"trust_indicator": "",