New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect output ordering in tests in some cases #1825

merged 3 commits into from Apr 24, 2018


1 participant
Copy link

ricardograca commented Apr 23, 2018


This ensures that output from database tests are ordered by model id.


Some tests require that the output is exactly the same as some predefined values. However, the previous PR mentioned above introduced a change that caused output ordering to be changed on PostgreSQL, even though the data is exactly the same.

There shouldn't be any need to check for ordering of results unless that is the intended purpose of a specific test.

Fixes #426.

Proposed solution

This just orders models inside collections by id after they are fetched from the database. This application side approach was chosen to avoid changing all the affected tests.

ricardograca added some commits Apr 23, 2018

Sort test results by model id
- This ensures that the order of results returned by the database
doesn't affect tests that are comparing them to pre-defined values with
a certain order.

@ricardograca ricardograca added the tests label Apr 23, 2018

@ricardograca ricardograca added this to To Do in Version 0.14.0 via automation Apr 23, 2018

@ricardograca ricardograca moved this from To Do to In progress in Version 0.14.0 Apr 23, 2018

@ricardograca ricardograca merged commit ae11cca into master Apr 24, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

Version 0.14.0 automation moved this from In progress to Done Apr 24, 2018

@ricardograca ricardograca deleted the rg-fix-tests branch Apr 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment