#83 test that by default results are ordered by submit_time descending
Merged 7 years ago by mjia. Opened 7 years ago by mjia.
taskotron/ mjia/resultsdb update_doc  into  develop

@@ -568,6 +568,19 @@ 

          assert len(data['data']) == 1

          assert data['data'][0] == self.ref_result

  

+     def test_get_results_sorted_by_submit_time_desc_by_default(self):

+         r1 = self.helper_create_result()

+         r2 = self.helper_create_result()

+ 

+         r = self.app.get('/api/v2.0/results')

+         data = json.loads(r.data)

+ 

+         assert r.status_code == 200

+         assert len(data['data']) == 2

+ 

+         assert data['data'][0]['id']== r2[1]['id']

+         assert data['data'][1]['id'] == r1[1]['id']

+ 

      def test_get_results_by_group(self):

          uuid2 = '1c26effb-7c07-4d90-9428-86aac053288c'

          self.helper_create_group(uuid=uuid2)

It seems like the default sort order 'submit_time' is not documented in the API docs. I can't find anywhere mentioning how to do it.
if anyone knows, could you point to me where to go?

rebased

7 years ago

@mjia

I can't find anywhere mentioning how to do it.

What is the "it" you can not find out how to do? Results are ordered by date, in descending order because it makes sense from the consumer standpoint - you should usually need/want the latest result corresponding to your query. Could you elaborate on the question (and maybe spin up a ticket for it, if it's something you really want to discuss?).
The PR looks good, I'll merge it shortly.

Commit db27e74 fixes this pull-request

Pull-Request has been merged by mjia@redhat.com

7 years ago

What is the "it" you can not find out how to do? Results are ordered by date, in descending >order because it makes sense from the consumer standpoint - you should usually need/want

I can't find where to update the docs. It would be good if we can update the APIs docs to reflect this behaviour.

Metadata