summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/resources
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2015-11-12 17:36:27 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2015-11-19 12:26:55 +0100
commit1a6d5d0a83b1356802bfab94e7663af3fa7ef861 (patch)
treeb5107ab8a0e977036e6d8e29b0ad934a0b748cb3 /utils/test/result_collection_api/resources
parent7b1c750b1bf38be2af727fa14528d223d29ed891 (diff)
add vIMS for dahsboard
JIRA: FUNCTEST-64 Change-Id: I344c3a882d64acdcd310decf015f234964faeb5a 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.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/utils/test/result_collection_api/resources/handlers.py b/utils/test/result_collection_api/resources/handlers.py
index 85c6172a5..be08c9791 100644
--- a/utils/test/result_collection_api/resources/handlers.py
+++ b/utils/test/result_collection_api/resources/handlers.py
@@ -719,6 +719,21 @@ class DashboardHandler(GenericApiHandler):
"error:Project name missing")
elif check_dashboard_ready_project(project_arg, "./dashboard"):
res = []
+
+ if case_arg is None:
+ raise HTTPError(
+ HTTP_NOT_FOUND,
+ "error:Test case missing for project " + project_arg)
+
+ # special case of status for project
+ if case_arg == "status":
+ del get_request["case_name"]
+ # retention time to be agreed
+ # last five days by default?
+ # TODO move to DB
+ period = datetime.now() - timedelta(days=5)
+ get_request["creation_date"] = {"$gte": period}
+
# fetching results
cursor = self.db.test_results.find(get_request)
while (yield cursor.fetch_next):
@@ -726,11 +741,7 @@ class DashboardHandler(GenericApiHandler):
cursor.next_object())
res.append(test_result.format_http())
- if case_arg is None:
- raise HTTPError(
- HTTP_NOT_FOUND,
- "error:Test case missing for project " + project_arg)
- elif check_dashboard_ready_case(project_arg, case_arg):
+ if check_dashboard_ready_case(project_arg, case_arg):
dashboard = get_dashboard_result(project_arg, case_arg, res)
else:
raise HTTPError(