summaryrefslogtreecommitdiffstats
path: root/testapi
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-07-18 15:52:28 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-07-19 10:09:51 +0800
commit1e7205a12171f0ad81391b56ffe1b2fe29e2bb6a (patch)
tree8e21ee0bad7b79122a78d2add047572c6e4edb61 /testapi
parentbba00ca773c4851de91ab19d34859b930b9e1960 (diff)
bugfix: mix order of Arno results
because start_date is not always in the same format or timezone, sort by start_date will be misordered some times, in this patch leverage '_id' to do the sort, it is generated by mongodb itself, always upscend. JIRA: FUNCTEST-694 JIRA: RELENG-213 Change-Id: Ie0ed5cd09c3f7abb1803d72abe5ecab440c1569c Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi')
-rw-r--r--testapi/opnfv_testapi/resources/result_handlers.py2
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_result.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/resources/result_handlers.py b/testapi/opnfv_testapi/resources/result_handlers.py
index 1773216..2e15e7a 100644
--- a/testapi/opnfv_testapi/resources/result_handlers.py
+++ b/testapi/opnfv_testapi/resources/result_handlers.py
@@ -147,7 +147,7 @@ class ResultsCLHandler(GenericResultHandler):
@in trust_indicator: query
@required trust_indicator: False
"""
- limitations = {'sort': {'start_date': -1}}
+ limitations = {'sort': {'_id': -1}}
last = self.get_query_argument('last', 0)
if last is not None:
last = self.get_int('last', last)
diff --git a/testapi/opnfv_testapi/tests/unit/resources/test_result.py b/testapi/opnfv_testapi/tests/unit/resources/test_result.py
index c8463cb..c314c54 100644
--- a/testapi/opnfv_testapi/tests/unit/resources/test_result.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_result.py
@@ -208,9 +208,9 @@ class TestResultCreate(TestResultBase):
class TestResultGet(TestResultBase):
def setUp(self):
super(TestResultGet, self).setUp()
+ self.req_10d_before = self._create_changed_date(days=-10)
self.req_d_id = self._create_d()
self.req_10d_later = self._create_changed_date(days=10)
- self.req_10d_before = self._create_changed_date(days=-10)
@executor.get(httplib.OK, 'assert_res')
def test_getOne(self):