summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/resources
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-05-25 15:32:54 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2016-05-25 17:39:12 +0200
commit27b0a60dc802a6834bc9b2b51274d4016a4b0b7f (patch)
treec1cc7bac0d7ba506c1d0e53c0d81c3aac5f827f9 /utils/test/result_collection_api/resources
parentf41cc29366b2660ef7d9cb85be6b04b737526f45 (diff)
Test API add start_date, stop_date parameters in results
Change-Id: I8c8c5b1d82e447fb7a7413368a919b3d3c7b99a6 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'utils/test/result_collection_api/resources')
-rw-r--r--utils/test/result_collection_api/resources/handlers.py3
-rw-r--r--utils/test/result_collection_api/resources/result_models.py22
2 files changed, 14 insertions, 11 deletions
diff --git a/utils/test/result_collection_api/resources/handlers.py b/utils/test/result_collection_api/resources/handlers.py
index 268d19aba..8cc68e912 100644
--- a/utils/test/result_collection_api/resources/handlers.py
+++ b/utils/test/result_collection_api/resources/handlers.py
@@ -620,9 +620,6 @@ class TestResultsHandler(GenericApiHandler):
"Could not find testcase [{}] "
.format(result.case_name))
- # convert payload to object
- result.creation_date = datetime.now()
-
_id = yield self.db.results.insert(result.format(), check_keys=False)
self.finish_request(self._create_response(_id))
diff --git a/utils/test/result_collection_api/resources/result_models.py b/utils/test/result_collection_api/resources/result_models.py
index 795621ab1..15684e229 100644
--- a/utils/test/result_collection_api/resources/result_models.py
+++ b/utils/test/result_collection_api/resources/result_models.py
@@ -6,7 +6,8 @@ class ResultCreateRequest(object):
case_name=None,
installer=None,
version=None,
- description=None,
+ start_date=None,
+ stop_date=None,
details=None,
build_tag=None,
scenario=None,
@@ -17,7 +18,8 @@ class ResultCreateRequest(object):
self.case_name = case_name
self.installer = installer
self.version = version
- self.description = description
+ self.start_date = start_date
+ self.stop_date = stop_date
self.details = details
self.build_tag = build_tag
self.scenario = scenario
@@ -31,7 +33,8 @@ class ResultCreateRequest(object):
"case_name": self.case_name,
"installer": self.installer,
"version": self.version,
- "description": self.description,
+ "start_date": self.start_date,
+ "stop_date": self.stop_date,
"details": self.details,
"build_tag": self.build_tag,
"scenario": self.scenario,
@@ -50,8 +53,8 @@ class TestResult:
self.pod_name = None
self.installer = None
self.version = None
- self.description = None
- self.creation_date = None
+ self.start_date = None
+ self.stop_date = None
self.details = None
self.build_tag = None
self.scenario = None
@@ -70,7 +73,8 @@ class TestResult:
t.pod_name = a_dict.get('pod_name')
t.project_name = a_dict.get('project_name')
t.description = a_dict.get('description')
- t.creation_date = str(a_dict.get('creation_date'))
+ t.start_date = str(a_dict.get('start_date'))
+ t.stop_date = str(a_dict.get('stop_date'))
t.details = a_dict.get('details')
t.version = a_dict.get('version')
t.installer = a_dict.get('installer')
@@ -98,7 +102,8 @@ class TestResult:
"project_name": self.project_name,
"pod_name": self.pod_name,
"description": self.description,
- "creation_date": str(self.creation_date),
+ "start_date": str(self.start_date),
+ "stop_date": str(self.stop_date),
"version": self.version,
"installer": self.installer,
"details": self.details,
@@ -115,7 +120,8 @@ class TestResult:
"project_name": self.project_name,
"pod_name": self.pod_name,
"description": self.description,
- "creation_date": str(self.creation_date),
+ "start_date": str(self.start_date),
+ "stop_date": str(self.stop_date),
"version": self.version,
"installer": self.installer,
"details": self.details,